#development
1 messages ยท Page 334 of 1
Thanks
Before i forget, Thanks @languid dragon
yo, no problemo my frand, hope ya figure it out
yo guys I have this line of code that I took from somewhere and applied it into my bot let messageArray = message.content.split(/\s+/g); but I wanna learn more about the split function regarding the forward/backward slashes and letters and even plus sign? because I have no idea about that /\s+/g thing... I couldn't find anything
(javascript)
I mean from what I've deducted, that equals to a space character but it would be faster?
oh regex
Yes \s+ is any space
so if the string has spaces
it splits that into an array
you can see more about regex here https://regexr.com/
Here's more on Regex expressions https://www.regexbuddy.com/regex.html
also the split() function https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split
ok ^_^ stumbled upon regex a few years ago when I was learning how to break complicated password using that rofl
I just used a tool back then
didn't actually learn anything
lmfao
I know what split does though :3 but damn gotta learn this regex
I mean
is it even faster than " "?
Regex makes life a lot easier tho
I do have a few well examples
its handy for anti-advertisement
removing anything with https:// and .gg
stuff like that
very practical uses
oh awesome
honestly imo i find it really fun to just play around at regexr.com
so I could implement that into my bot
Yes
oooh so forward slash is the opening "tag" for regex and forward slash g is the closing tag
ok
now it makes sense
/ /
is a regex
its almost the same as " "
\s is a whitespace
- adds all spaces as a single thing
so if you have <- this
it'll be one object
so you can have as many spaces between arguments and still work
anyway thanks a lot for the info on that
man you're helpful
so glad I asked in here
No problemo dude, glad i can help :-]
I made it so that when mentioning the bot at start with nothing else or with saying help afterwards he will send you the help ^_^
if(message.content.indexOf(message.guild.me.toString()) == 0) {
let messageArray = message.content.split(/\s+/g);
let botMention = messageArray[0];
let args = messageArray.slice(1);
if(!args[0] || args[0] === `help`)
module.exports.printHelp(message, prefix);
}
I may aswell think of making it so that mentioning the bot acts like the prefix or something like that
I mean if anyone wants to use bot mention instead of prefix
lel
just thinking...
something like
if(message.content.indexOf(message.guild.me.toString()) == 0) {
let messageArray = message.content.split(/\s+/g);
let command = messageArray[1];
let args = messageArray.slice(2);
}
and so I did ๐ it's nice
wrong channel
wrong channel yeah xd
lol
How do i convert a message sending in the console to sending it into a channel?
Expample:
search(args[1], opts, function(err, results) {
if(err) return console.log(err);
console.dir(results);
});```
Im using the youtube-search package
how can I write a command that makes the bot join the author's voice chat
`if (message.content === '!play') {
// Note that this will only work if the message was sent in a guild
// and the author is actually in a voice channel.
// You might want to check for all that stuff first
const channel = message.member.voiceChannel;
channel.join()
.then(connection => console.log('Connected!'))
.catch(console.error);
}`
some thing like that
hello
i need help in this ```js
if(message.content === (prefix + "mute")) {
if(!message.member.hasPermission("MANAGE_MESSAGES")) return message.channel.send("You dont have MANAGE_MESSAGES permission.");
let toMute = message.guild.member(message.mentions.users.first()) || message.guild.members.get(args[0]);
if(!toMute) return message.channel.send("You didn't specify a user mention or ID!.");
let role = message.guild.roles.find(r => r.name === "SSBOT Muted");
if(!role) {
try {
role = message.guild.createRole({
name: "SSBOT Muted",
color: "#000000",
permissions: []
});
message.guild.channels.find.forEach(async (channel, id) => {
await channel.overwritePermissions(role, {
SEND_MESSAGES: false,
ADD_REACTIONS: false,
SEND_TTS_MESSAGES: false,
});
});
} catch(e) {
console.log(e.stack);
}
}
if(toMute.roles.has(role.id)) return messgae.channel.send("This user is already muted!.");
return;
}```
i get Parsing error: Unexpected token => (Fatal)
as an error
^^
if(message.content === (prefix + "mute")) {
if(!message.member.hasPermission("MANAGE_MESSAGES")) return message.channel.send("You dont have MANAGE_MESSAGES permission.");
let toMute = message.guild.member(message.mentions.users.first()) || message.guild.members.get(args[0]);
if(!toMute) return message.channel.send("You didn't specify a user mention or ID!.");
let role = message.guild.roles.find(r => r.name === "SSBOT Muted");
if(!role) {
try {
role = message.guild.createRole({
name: "SSBOT Muted",
color: "#000000",
permissions: []
});
message.guild.channels.find.forEach(async (channel, id) => {
await channel.overwritePermissions(role, {
SEND_MESSAGES: false,
ADD_REACTIONS: false,
SEND_TTS_MESSAGES: false,
});
});
} catch(e) {
console.log(e.stack);
}
}
if(toMute.roles.has(role.id)) return >messgae<.channel.send("This user is already muted!."); //GRAMMAR SON!
return;
}```
@shrewd field
what are the most common commands that every bot should have? I know of help and info. what else?
Anyone good at JS and SQLite?
@ornate shadow ping
ooook I have that one
I mean that's too basic xD
but it's still a valid answer, thanks
var prefixargs = args.join(" ");
if(!msg.member.permissions.has('MANAGE_MESSAGES')) return msg.channel.send(" You don\'t have permission to change the prefix.");
if(!prefixargs) return msg.channel.send(" You must actually provide a prefix!")
sql.run("CREATE TABLE IF NOT EXISTS prefixes (guildId TEXT, prefix TEXT)").then(() => {
sql.run("INSERT INTO prefixes (guildId, prefix) VALUES (?, ?)", [${msg.guild.id}, ${prefixargs}]);
});
sql.get(`SELECT * FROM prefixes WHERE guildId =${msg.guild.id}`).then(row => {
if(!row) {
sql.run("INSERT INTO prefixes (guildId, prefix) VALUES (?, ?)", [`${msg.guild.id}`, `${prefixargs}`]);
msg.channel.send(` Successfully changed the prefix to \`${prefixargs}\`!`)
} else {
sql.run(`UPDATE prefixes SET prefix = ${prefixargs} WHERE guildId = ${msg.guild.id}`);
msg.channel.send(` Successfully changed the prefix to \`${prefixargs}\`!`);
}
});
Error: SQLITE_ERROR: no such column:

๐คฆ
I gave up on that >_> @pale light
Oh rip
I tried looking at it but it looks fine
god dammit I suck so hard Q_Q
can anyone teach me, using Node.js and MySQL, how to store a value off a table into a variable? I'm really having trouble doing so...
mm, I know about SQLite but that's it
I'd recommend looking at the docs
they've got to have an example for something like that
docs of what?
sqlite and mysql have basically the same syntax
I don't even know anymore what's my code cuz I googled a lot and changed it a lot but gonna paste what I got rn...
What ORM you using
what's that?
I seriously doubt he's using an ORM
Object Relation Map
fail exmaple
ehm, no
let sql;
con.query(`SELECT cooldown FROM xp WHERE id = '${message.author.id}'`, function (err, result, fields) {
if (err) throw err;
sql = result;
console.log(result);
});
ok this is one way I tried it and it makes sql undefined...
ew, use prepared statements
let sql = `SELECT cooldown FROM xp WHERE id = '${message.author.id}'`;
this is another way
the result would be one line
result[0].something
unless there is multiple cooldowns
you'd literate through them
Use this http://docs.sequelizejs.com/,
Define the model then you can do something like
You can do something like;
models.GuildMembers.findAll({ where: { family_name: 'abc' }}).then((guild_members) => {
console.log(guild_members)
})
[1][2][3] etc
I wouldn't suggest using an ORM at this level
well there's only one value, @languid dragon
show table?
mysql> SELECT cooldown FROM xp WHERE id = 95917302813310976;
+----------+
| cooldown |
+----------+
| 60 |
+----------+
1 row in set (0.00 sec)
mysql>
@ornate shadow
Try this instead:
con.query(`SELECT cooldown FROM xp WHERE id = '${message.author.id}'`, function (err, result, fields) {
if (err) throw err;
console.log(result);
});
You are trying to assign result to sql ya?
C:\Users\Chipp\Desktop\Yasashii Bot 0.1.3 PBE\node_modules\mysql\lib\protocol\Parser.js:80
throw err; // Rethrow non-MySQL errors
^
TypeError: Cannot read property 'cooldown' of undefined
yes I am
I just want that int value of 60
from that table
never used sql before and I'm not the best at javascript
con.query(`SELECT * FROM xp WHERE id = '${message.author.id}'`, (err, rows) => {
if(err) throw err;
let experience = 0.0;
let letters = message.content.length;
if(letters > 100)
letters = 100;
for (let i = 1; i <= letters; i++)
experience += ((100 - i) + 1) / 100;
experience = Math.ceil(experience);
console.log(experience);
let sql;
con.query(`SELECT cooldown FROM xp WHERE id = '${message.author.id}'`, function (err, result, fields) {
if (err) throw err;
console.log(result);
});
if(experience > sql.cooldown) {
experience = sql.cooldown;
}
con.query(`UPDATE xp SET cooldown = cooldown - ${experience}`);
console.log(`${sql.cooldown} = ${sql.cooldown} - ${experience}`);
if(rows.length < 1) {
sql = `INSERT INTO xp (id, xp) VALUES ('${message.author.id}', ${experience})`
} else {
let xp = rows[0].xp;
sql = `UPDATE xp SET xp = ${xp + experience} WHERE id = '${message.author.id}'`;
}
con.query(sql);
});
well deleted the sql = result;
Thanks let me read
trying to get sql.cooldown but u havent assigned anything to sql
also the rest of that code needs to go in the callback
Try this
con.query(`SELECT * FROM xp WHERE id = '${message.author.id}'`, (err, rows) => {
if(err) throw err;
let experience = 0.0;
let letters = message.content.length;
if(letters > 100)
letters = 100;
for (let i = 1; i <= letters; i++)
experience += ((100 - i) + 1) / 100;
experience = Math.ceil(experience);
console.log(experience);
let sql;
con.query(`SELECT cooldown FROM xp WHERE id = '${message.author.id}'`, function (err, result, fields) {
if (err) throw err;
console.log(result);
sql = result
if(experience > sql.cooldown) {
experience = sql.cooldown;
}
con.query(`UPDATE xp SET cooldown = cooldown - ${experience}`);
console.log(`${sql.cooldown} = ${sql.cooldown} - ${experience}`);
if(rows.length < 1) {
sql = `INSERT INTO xp (id, xp) VALUES ('${message.author.id}', ${experience})`
} else {
let xp = rows[0].xp;
sql = `UPDATE xp SET xp = ${xp + experience} WHERE id = '${message.author.id}'`;
}
con.query(sql);
});
});
yeah that looks better
The problem was sql var was being called before your sql query (select cooldown) finished executing
3
[ RowDataPacket { cooldown: 60 } ]
undefined = undefined - 3
44
[ RowDataPacket { cooldown: 60 } ]
undefined = undefined - 44
44
[ RowDataPacket { cooldown: 21 } ]
undefined = undefined - 44
this is the console.log ๐
still undefined
Which line that from?
the thing is that I was using sql already for something else and figured I would use it for getting data off my table before overwriting it with some new code
but I will try that
crash
C:\Users\Chipp\Desktop\Yasashii Bot 0.1.3 PBE\node_modules\mysql\lib\protocol\Parser.js:80
throw err; // Rethrow non-MySQL errors
^
TypeError: Cannot read property 'cooldown' of undefined
Paste the output of result
con.query(`SELECT cooldown FROM xp WHERE id = '${message.author.id}'`, function (err, result, fields) {
if (err) throw err;
console.log(result);
Need to find out the format it returns first
[ RowDataPacket { cooldown: 60 } ]
Oooo
con.query(`SELECT * FROM xp WHERE id = '${message.author.id}'`, (err, rows) => {
if(err) throw err;
let experience = 0.0;
let letters = message.content.length;
if(letters > 100)
letters = 100;
for (let i = 1; i <= letters; i++)
experience += ((100 - i) + 1) / 100;
experience = Math.ceil(experience);
console.log(experience);
let variable;
con.query(`SELECT cooldown FROM xp WHERE id = '${message.author.id}'`, function (err, result, fields) {
if (err) throw err;
console.log(result);
});
if(experience > variable.cooldown) {
experience = variable.cooldown;
}
con.query(`UPDATE xp SET cooldown = cooldown - ${experience}`);
console.log(`${sql.cooldown} = ${sql.cooldown} - ${experience}`);
let sql;
if(rows.length < 1) {
sql = `INSERT INTO xp (id, xp) VALUES ('${message.author.id}', ${experience})`
} else {
let xp = rows[0].xp;
sql = `UPDATE xp SET xp = ${xp + experience} WHERE id = '${message.author.id}'`;
}
con.query(sql);
});
I changed the sql variable into variable variable so you can see what's my intention
Try add this and paste the output
console.log(result.cooldown)
console.log(sql.cooldown)
ok
I did but undo'd
con.query(`SELECT * FROM xp WHERE id = '${message.author.id}'`, (err, rows) => {
if(err) throw err;
let experience = 0.0;
let letters = message.content.length;
if(letters > 100)
letters = 100;
for (let i = 1; i <= letters; i++)
experience += ((100 - i) + 1) / 100;
experience = Math.ceil(experience);
console.log(experience);
let sql;
con.query(`SELECT cooldown FROM xp WHERE id = '${message.author.id}'`, function (err, result, fields) {
if (err) throw err;
console.log(result);
sql = result
if(experience > sql.cooldown) {
experience = sql.cooldown;
}
con.query(`UPDATE xp SET cooldown = cooldown - ${experience}`);
console.log(`${sql.cooldown} = ${sql.cooldown} - ${experience}`);
if(rows.length < 1) {
sql = `INSERT INTO xp (id, xp) VALUES ('${message.author.id}', ${experience})`
} else {
let xp = rows[0].xp;
sql = `UPDATE xp SET xp = ${xp + experience} WHERE id = '${message.author.id}'`;
}
con.query(sql);
});
});
The rest of the code starting from line if (err) throw err; till con.query(sql); needs to be in the callback of con.query(SELECT cooldown FROM xp W`
well that's exactly what I'm trying to tell you
I'm using sql for two purposes
read my paste for when I changed my sql variable into variable variable to avoid confuzion
I may aswell remove that variable part and the code will still work but that would defeat the purpose of me struggling to make variable work
the variable part is a totally different part in the code and it's not until the end
just a snippet
Ya I understand
But nodejs not like that
It's asynchronous
So if you make a sql query in the middle of the code, nodejs will not wait for it to finish, but just continue on running
To make it wait you need to insert rest of the code inside the callback
That's what also make it fast xD
undefined
undefined
the two lines of code
console.log(result.cooldown)
console.log(sql.cooldown)
You see this
con.query(`SELECT cooldown FROM xp WHERE id = '${message.author.id}'`, function (err, result, fields) {
// To ensure you have value from result, rest of the code to be here
// So you assign sql = result here.
});
Ok wait
ok
Try add this line
con.query(`SELECT * FROM xp WHERE id = '${message.author.id}'`, (err, rows) => {
if(err) throw err;
let experience = 0.0;
let letters = message.content.length;
if(letters > 100)
letters = 100;
for (let i = 1; i <= letters; i++)
experience += ((100 - i) + 1) / 100;
experience = Math.ceil(experience);
console.log(experience);
let sql;
con.query(`SELECT cooldown FROM xp WHERE id = '${message.author.id}'`, function (err, result, fields) {
if (err) throw err;
console.log(result);
// CHANGE HERE
sql = result[0]
console.log(sql)
if(experience > sql.cooldown) {
experience = sql.cooldown;
}
con.query(`UPDATE xp SET cooldown = cooldown - ${experience}`);
console.log(`${sql.cooldown} = ${sql.cooldown} - ${experience}`);
if(rows.length < 1) {
sql = `INSERT INTO xp (id, xp) VALUES ('${message.author.id}', ${experience})`
} else {
let xp = rows[0].xp;
sql = `UPDATE xp SET xp = ${xp + experience} WHERE id = '${message.author.id}'`;
}
con.query(sql);
});
});
sql = result[0]
[ RowDataPacket { cooldown: 60 } ]
RowDataPacket { cooldown: 60 }
probably first from result and second from sql
I think it might be fixed now
Rest of the code should work
dunno
lemme try
holy shit it works!!!!
๐ ๐ ๐
thank you so much but I have no idea how
gotta study this code now LOL
๐
Read about nodejs control flow to understand how it works better
ok thank you so much! ^_^
Np
How do I send a DM with Eris?
isn't it something like
getDMChannel(userID)```
and then send it
Yeah, TypeError: Request path contains unescaped characters
Trying to send a embed.
show the part of the code that gives the error
Okay, thank you
Discord.js How would i restrict a command to only people who have upvoted
Check who upvotes your bot and then make an if statement that blocks the people who dont upvote
getDMChannel returns a promise, you need to use .then or await @neon pasture
wat
no
you need to use bot.getDMChannel(msg.author.id).then or use async/await
pls tell me u know what that means
np
Isnt the dm channel id the same as the users id? My bot just send a message to the users id and that dms them
^
:3
hey i have this code for a mute command but it wont work and wont give any errors
if(message.content === "mute") {
if(!message.member.hasPermission("MANAGE_MESSAGES")) return message.channel.send("You dont have MANAGE_MESSAGES permission.");
let toMute = message.guild.member(message.mentions.users.first()) || message.guild.members.get(args[0]);
if(!toMute) return message.channel.send("You didn't specify a user mention or ID!.");
let role = message.guild.roles.find(r => r.name === "{SS}BOT Muted");
if(!role) {
try {
role = message.guild.createRole({
name: "{SS}BOT Muted",
color: "#000000",
permissions: []
});
message.guild.channels.find.forEach(async (channel, id) => {
await channel.overwritePermissions(role, {
SEND_MESSAGES: false,
ADD_REACTIONS: false,
SEND_TTS_MESSAGES: false,
});
});
} catch(e) {
console.log(e.stack);
}
}
if(toMute.roles.has(role.id)) return message.channel.send("This user is already muted!.");
return;
}```
no error
no response
looking for experienced node developers to take on paid work, PM me if interested
did i hear money
lol
How do i convert a message sending in the console to sending it into a channel?
Expample:
search(args[1], opts, function(err, results) {
if(err) return console.log(err);
console.dir(results);
});```
Im using the youtube-search package
get channel by id -> send
startsWith vs ==
message.startsWith?
object
startsWith is for strings
i want a mention prefix like @spice wren when i type @tired lodgename it will send prefix fix is - how can i do that?
a mention is formed as <@id>
so yours is @fickle solstice
or <@!id> if it has a nickname
<><>
if(string matches "<@!?yourid>"
@earnest phoenix use discord.ext.commands instead of some message.content stuff
@commands.command(pass_context=True)
async def play(self,ctx,url):
-- play url and stuffs
args = message.content.split(" ")
some other stuff```
oh:I
ew
theres one for js i believe
discord.js-commando
.js or .io ?
js afaik
@inner jewel example? for my code ^^^
look at the lib docs
I think I fucked up somewhere and used both
how to get channel by id
but js primarily
and etc
can't find an example on it from the discord js docs
do what
@shrewd field You are try/catching within that code, but I don't think e.stack is a thing
when trying to log an undefined property, it won't log anything at all
Iirc
it is
when I try to run this with a youtube link it says song is not defined
anyone got an idea why?
Are you sure you're getting the right args?
args[1]
are you sure it's not args[0]
?
if the command is .spela (link) it should take the link right?
depends how you set it up
also, nice stolen code
from trek example code
Ytdl*
yeah I started doing bot stuff this week
very new
If you just started making a bot, I wouldn't try music until you're experienced
oh well I got it to play music from a constant
I started my bot as a music bot 
I got it to work btw
thanks @earnest phoenix it was args[0] that was the actual link
np
Is it OK if I let my bot create tables for each guild? Or should I just add another column for the user's guild?
(SQL)
I think I should just add a column...
just add a row with the guild id
A fucking column lol, a row is just fine and better
dav says arrays start at 1

where do I request a bot?
'request a bot'?
request for someone to make a bot for an app
like I'm wanting a bot for free gold for tanks, how do I request that
First of all, you're thinking of the wrong kind of bot
we make chat bots / Discord bots
second of all, wrong channel
and third, our goal isn't to make free bots for people, so you won't be "requesting a bot"
yea sorry, Im in the wrong channel
xD
wut te fuk
๐
are you able to make your bot send a welcome message to a guilds general channel when it first joins?
also if a user doesnt have an avatar like me, how do you show the default avatar?
u have to use some calculations
I log it like
@boot
$boot = Time.now
end
and on demand
Time.now - $boot
stuff
idk how tho thats the reason xP
And then calculate it using modulators or however they are called
modulo
ty
Time.now.hours
so i could do this maybe?
no
ok
ok
can u do multiple embeds in the same message?
I have a question about the API of discordbots.org... where do you use it, and how?
use it using snekfetch
snekfetch
yes
Do you use discord.js?
ye
Googling npm system information
I found
https://www.npmjs.com/package/systeminformation
if you read the documentation i believe it should be ezpz to get the memory usage
ok ty
hey, just a disclaimer: https://github.com/giulio1234 has been going around forking bots and leaking tokens on github. not sure if these are stolen. but I found his id and it seems like he's here and on dbots as well, so to the mods, keep a eye out for 294129532531638272 and possible clone bots
@sharp galleon
@pearl cliff
๐คท
@earnest phoenix You should probably fix that https://weeb.hacked-your.webcam/ce9f96c.png
You should also add this to your body to fix the clipping of the bottom background-attachment: fixed;
How can I select a .json file? Like in php it's file_get_contents. But how do I use that in javascript?
i think you can do that with just the require thing
const jsonFile = require("./file.json");```
How do I read a json file from a url instead local with fs.readFile
Still things the url is a file.
open 'C:\Users\User\Documents\Eigen Projecten\discord\popcorntime\https:\link.com/test'
const http = require("http");
const file = fs.createWriteStream("file.docx");
http.get("http://www.example.com/test.docx", response => {
response.pipe(file);
});
but what is file.docx then?
๐ฅ ๐ถ
ngl not sure
You GET the file, you just use the file variable to use it
why would my uptime be showing this?
Lib
isn't that just input1 handler input2
@lethal sun use math.js module
require("math.js").eval("2 * 3 + 5")
I think it's actually called "math"
@small solar that's because the variable that you are using for uptime is not a valid number
it should be in milliseconds
@small solar Because you may use a module that expect a number
And you don't give a number
Maybe a string
tt
may i ask if this is the correct way to use the .status function?
client.user.status(dnd)
the lib is discord.js
it crashed
client.status.number(2)
this prob wrong too
@lethal sun client is what then defined as the "bot client"
Lol
@lethal sun "bot" vs "client" are variable names
you can't say it's wrong if you haven't even read where he declares it
ye i figured that out
how do i set it to be idle/dnd
client.user.setStatus("idle")
wot ๐
wot ^ 2
fixing shit
be back
Guys how can i make a "Playing [GAME]" under the bot's name?
Lib?
update presence
?-?
Discord.JS?
yes
this will help me?
read it
ok
It is the official documentation?
i mean they could also use .setGame
guys thank you
ClientUser.setPresence(https://discord.js.org/#/docs/main/stable/typedef/PresenceData)
the user instance of your client/bot
i use client
anyways thanx
np x
wtf
If you change your status too often
your status cannot be changed for some time
its to prevent status change spamming
i just did it once
restarting the bot also changes its status
yeah i know
its a bug because the other times it wasnt working
so i wasnt abusing the changing thing
oh lmao it fineally changed to dnd
it took long
working now
yeet, nice
natan plx
@earnest phoenix easiest way to use a custom emoji is to have them in your server or something right
then you do this
var emoji_to_use = client.guilds.get(your_guild_id).emojis.get(emoji_id)
and then send emoji_to_use or message.react(emoji_to_use )
Should work like that
'test'
});```
How do I add content inside the createMessage?
Content?
You mean the message itself?
remove the {'test'}
and replace it with "The message to send"
it only needs to be string ๐
Thanks ๐
np xox
little help here, i try to make a command but it says something with /NN at the end in the cmd, what does it mean?

hello
so you have any idea?
What lib?
discord.js
/NN at the end of your command?
no, i mean i use a fake keyword to check if the command works, wich is voicetestingXDok but whenever i use it it shown on the cmd
i /NN
wrote /NN
voicetestingXDok /NN
if i say "i wrote voicetestingXDok"
to other commands it does not happen
else if(args[i].includes("voicetestingXDok"))
{
console.log(`in yay`);
voiceTTS(msg, args);
return;
}
it doesn't even show the console.log
case "yt":
if (args[1]) {
search(args[1], opts, function(err, results) {
if(err) return message.reply(`${err}`);
message.reply(`${results}`);
});
} else {
message.channel.send("smh...")
}
break;```
How do i make so the "results" gets send in a channel and not console... I did that code ^ but this is what I get: https://imgur.com/uc613rJ
Isnt it supposed to be arg[0]
Arrays always start at 0 and not 1
later can you help me with my problem?
it still does this: https://imgur.com/uc613rJ @prime cliff
how do i check if my bot has a specific permission?
message.channel.permissionsFor(msg.guild.me).has('permission name')
@lethal sun Try results.url
or message.channel.permissionsFor(client.user).has('JASS_PERM') @median lintel
if (!message.author.id === owner) return message.channel.send(`:no_entry_sign: You aren't the owner of the bot.`);
why wouldn't this be working in my eval?
owner could be not defined
owner is a thing tho
if it is defined properly it would work properly
ok
how do you use some kind of for each thing to send a message in a channel for each object in an array?
and also how do you get the position/content too?
like i have an array with 2 or 3 objects (containing user ids), so for each object in the array, i want to send a message to a channel with the position its in the array, and the content of it
does that make more sense?
for(var index = 0; array.length>index; index++){
array[index].id
}
?
Really depends
for(var object in array){}
@small solar Umm, no
you can't put a ! before something within an IF if you are using ===
Oh..
if (message.author.id !== owner) return message.channel.send(`:no_entry_sign: You aren't the owner of the bot.`);```
Thx
No problem
I have this here:
<body background="http://htmlcolorcodes.com/assets/images/html-color-codes-color-tutorials-hero-00e10b1f.jpg">
And for some reason this isnt changing my background
for the page
oh okay
style="..."
Is an attribute
okay
<body style="http://htmlcolorcodes.com/assets/images/html-color-codes-color-tutorials-hero-00e10b1f.jpg">
correct @languid dragon?
Lmfao no
oh
Do you know CSS?
so
<style>
background-image: "url"
</style>
erm
still not appearing...
<style>
background-image: "http://htmlcolorcodes.com/assets/images/html-color-codes-color-tutorials-hero-00e10b1f.jpg"
rest of code
</style>
ah okay
does the </style> go at the very end of my code
or like
<style>
background-image: url"http://htmlcolorcodes.com/assets/images/html-color-codes-color-tutorials-hero-00e10b1f.jpg"
</style>
okay
And helps 2 be at the end or inside head tags
okay
๐ฉ
@wanton nova U here
Iโll show u
It might look weird since im writing this from mobile
<style>
.body {
background-image: url(the url);
}
</style>
Use that ^^
mostly good except for indents, but that's style, not function
Im still not getting the background :P
<style>
body: {
background: url("https://www.walldevil.com/wallpapers/w05/anime-manga-buildings-architecture-urban.jpg") no-repeat center center fixed;
background: url("url") no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
</style>
i dont really want the fancy things, yet the style...
Im not sure if i should put it like you have
or put it at the very end of my code
dont think it'll make any difference lol
but i'm not shure
everything was blank
gimme ur bg url pls
oh sorry
i wasnt paying attention xD
<html>
<head>
<style>
body: {
background: url("http://htmlcolorcodes.com/assets/images/html-color-codes-color-tutorials-hero-00e10b1f.jpg") no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
</style>
<font face="Verdana" color="#BDC3C7">
<center><h1>Snap</h1>
<p>This is a bot where you can do multiple things!</p>
<p><font size="4"> Some Commands: <br />
โผ๏ธ >Help โน๏ธ <br />
Shows this page but preetier! <br />
โผ๏ธ >Ping ๐ <br />
Shows my ping! <br />
โผ๏ธ >Minecraftuser ๐ฅ <br />
Shows information about the specificed Minecraft Player! <br />
โผ๏ธ >Avatar ๐ค <br />
Sends a link of Specificed User's Avatar or Your Avatar! <br />
โผ๏ธ >Play โฉ <br />
Plays music! <br />
โผ๏ธ >Queue ๐ <br />
Shows the music in queue! <br />
โผ๏ธ >Np โถ <br />
Shows currently playing song! <br />
โผ๏ธ >Pause โธ <br />
Pauses the music! <br />
โผ๏ธ >Unpause โฏ <br />
Unpauses the music! <br />
โผ๏ธ >Skip โ <br />
Skips the currently playing song! <br />
โผ๏ธ >Stop โน <br />
Stops the music! <br />
โผ๏ธ >Userinfo ๐ <br />
Shows information about a user! <br />
โผ๏ธ >Serverinfo ๐ <br />
Shows information about the server! <br />
โผ๏ธ >Uptime ๐ <br />
Shows how long I've been up for! <br />
โผ๏ธ >Calculate โ <br />
Helps you calculate a math problem! <br />
โผ๏ธ >Botinfo ๐ค <br />
Gets the bot's info! <br />
โผ๏ธ >Servers ๐ <br />
Fetches how many servers the bot is in! <br />
</p>
</html>
</font>
</center>
@rich kiln
you dont need html tag.
also.
</html> </font> </center>
html tag should be like the last tag 
try it lol
ok give me a sec
<style>
body: {
background: url("http://htmlcolorcodes.com/assets/images/html-color-codes-color-tutorials-hero-00e10b1f.jpg") no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
</style>
<center>
<h1>Snap</h1>
<p>This is a bot where you can do multiple things!</p>
<p>
<font size="4"> Some Commands: <br /> โผ๏ธ >Help โน๏ธ <br /> Shows this page but preetier! <br /> โผ๏ธ >Ping ๐ <br /> Shows my ping! <br /> โผ๏ธ >Minecraftuser ๐ฅ <br /> Shows information about the specificed Minecraft Player! <br /> โผ๏ธ >Avatar ๐ค <br /> Sends a link of Specificed User's Avatar or Your Avatar! <br /> โผ๏ธ >Play โฉ <br /> Plays music! <br /> โผ๏ธ >Queue ๐ <br /> Shows the music in queue! <br /> โผ๏ธ >Np โถ <br /> Shows currently playing song! <br /> โผ๏ธ >Pause โธ <br /> Pauses the music! <br /> โผ๏ธ >Unpause โฏ <br /> Unpauses the music! <br /> โผ๏ธ >Skip โ <br /> Skips the currently playing song! <br /> โผ๏ธ >Stop โน <br /> Stops the music! <br /> โผ๏ธ >Userinfo ๐ <br /> Shows information about a user! <br /> โผ๏ธ >Serverinfo ๐ <br /> Shows information about the server! <br /> โผ๏ธ >Uptime ๐ <br /> Shows how long I've been up for! <br /> โผ๏ธ >Calculate โ <br /> Helps you calculate a math problem! <br /> โผ๏ธ >Botinfo ๐ค <br /> Gets the bot's info! <br /> โผ๏ธ >Servers ๐ <br /> Fetches how many servers the bot is in! <br />
</p>
</center>
try that.
k
ok theres so much wrong with his code i wanna cry
also <font size="4">
there is no </font>
so its an open tag
that'll create errors
well use a request or snekfetch to grab the the information to display
ยฏ_(ใ)_/ยฏ
I didnt notice the โfont size=4โ ๐๐
5 > 4
well yeah, basic math? DUHHH
well it would be a massive json object
you'd need to literate through it
if you want to see what the object looks like just console.log(result)
๐
๐
step 1: cut a hole in a box
thanks
but step one is geting a eval command
then entering !eval client.user.token
in a public chat
r u asking a genuine question or
@languid dragon i know how to code a bot
ok lol
this was a joke if you agree
console.log("the following results for changing the status")
console.log(result)
ยฏ_(ใ)_/ยฏ
how do i make reactions
wym @earnest phoenix
i cant put shit together from the docs
like?
making reactions is harder than embeds
I wanna know what you are trying to do
Making reactions in embeds?
tf do you mean by that
no
What are you trying to do @earnest phoenix
so anyways
Making emojis
or reacting to a message with an emoji
^^^^^^^
when it sends the message it want it to make 3 reactions
message.react(emoji)
message.channel.send('dsadsa').then(e =>{
e.react('EMOJI')
})
But instead of 1
Do 3
And also
Embeds aint hard
^^^^^^ Go to that it helps alot
i know that
i said embeds are easyier than reacting emotes
prob had made a mistake
if you need to get an emoji from some server simply do
var emojiToUse = client.guilds.get("guild_id").emojis.find("name", "nameOfEmoji")
then message.react(emojiToUse)
;p
It will just add more emotes to it ;p
You want an emoji collector
^^^^^^^
i oh ready know how to change the status tho
ill check that out
"emoji collector"
listen here
how to make donate bot?
get a patreon then dm-adv it
everyone is
ahhh
@white pebble your bot is shit smh
message.channel.send('The game has started!').then(e =>{
e.react('red_circle')
e.react('large_blue_circle')
})
seems like this code makes my bot crash
where are the ::
@flint urchin there is this great button in discord, that they spent time developing please use it https://i.imgur.com/ZDLvwWD.png
wrong ss
@fossil oxide update lol, I know you were checking my bots ๐, but why?
why is ur discord not in english
people can use other languages that are not english
DM ads patreon
The only other language is weab
How to make FFmpeg work when hosting on Heroku? ๐ค
waht if i say that im broke?
oo I know how to fix that step 1 get money step 2 be unbroke step 3??? step 4 profit
get a 3.5$ ovh vps
better yet, a $7 VPSDime VPS
More money but it has 6GB of ram and 4 cpu vcores
It also performs better than the cloud ram server i got from OVH
hey, i need to know
what was the best percent of bots to people to know if the server is a bot collection server
i say 70%
Dont only base bot farms off of percentages, that's a bad idea
that makes sense too ^
^ yup
then how would i do then
if above 100 users and bot to human ratio is above 70%
ok so
why even make your bot leave these farms
because its a waste
anyway
same
I've never seen anybody have an issue with bot farms using more resources than any other guild
But if you insist on leaving them
if the member count is about > 100, check the ratio is more than 1:4?
Hello, everyone! ^_^ For some reason bot.users.size returns (the actual number of users) + 1 for some reason. Yes, I included the bot itself. Any ideas why? ๐
i.e on my testing server I have 9 users in total, including the bot, but it returns 10
using node.js
and obv discord.js
no
I would if I knew exactly what's up with it
if I'd know that it puts +1 just for the lulz, I'd -1 it
but probably not
I think so, yes
I'm using a PBE bot on my official bot server though and that bot is only in one guild and I can clearly see and number its members and they're 9
yet it outputs 10
๐
how can it see one more?
yeap
Clyde used to be a user
used to be lol
What is the command prefix for the bot; Auattaja?
try -prefix @bot
@median lintel You should filter by removing the bot out of it, just to make it only counts non user bots
wrong ping
@ornate shadow
?
How many non users bot are there in the server?
In my bot's official server?
w/e
2 - the bot and the PBE bot
Exactly
Yes
10
Then would 7 + you = 8 + 2 bots = 10?
No
Sec
tyt
Switching to pc
Alright
can anywho help pls
can i use this for when i say "lmao" it will react this?
if(message.content.includes(lmao)) {
message.react(`๐`);
};
lmao
it aint working right now
@neat falcon what should i use?
yeah
i use it kek
kthx
@devout jackal You forgot to add " "
@vale orbit can i use back slash?
For?
on ready, do setinterval that changes the game
client.on('ready',() => {
setInterval(() => {
client.user.setGame('new game')
},60000)
}```
thanks
You should really do bot.setInterval instead of setInterval
so it destroys itself when the client dies
Is that a function? Forgot about that
You mean your profile or the actual bot page?
@earnest phoenix boop
You need to use css for that here is an example......
Ok just add that to your css and change the url to your background https://weeb.hacked-your.webcam/bc9b4ef.png
Btw you cant edit your perm if you dont have a bot?
Or one that has been verified?
Yea
Just letting you know @earnest phoenix
Dont ask or they will postpone your bot
Or even decline
Anything on the lines of
Im waitingfor my bot to be accepted
will either be postponed
Or declined
Hello
Tonkkubot
rigged.
I would rather have it not be there lul
just realizes this is development
kek
anyone got any recommendations for npm modules for image editing? 
Jimp, if you want easy maybe canvas. Jimp as more advanced i think
ok
@clear kernel dont recommend jimp tho
y
@median lintel use canvas, jimp takes one year to process an image, also cant do like 89% things that canvas can do

...

