#development
1 messages · Page 454 of 1
the one you are using is correct
Oh
bot.setTimeout(() => { Message.edit("I am sorry..."); }, 1000);
bot.setTimeout(() => { Message.edit("I never meant to hurt you..."); }, 6000);
so like that
so there is a 5 second delay?
yes, this will create 2 timeouts, one after 1000ms, the next one after 6000ms, so there is a 5000ms delay between them
you'd be better off doing something like this though
const sentences = [
"I am sorry...",
...
"Always will :heart:"
];
message.channel.send('Griffin....').then((msg) => {
for (const sentence of sentence) {
msg.edit(sentence);
timeout N;
}
}
afaik, timeout doesnt pause loops
I just want something
unless you need the timeouts to differ specifically from sentence to sentence
that will work
How to create channel using command ?
@quartz kindle depends on the timeout function you write, it's certainly possible
I just want something that works
yes but the way you showed it all the timeouts will still be executed at once
this is important to me
@tardy viper you can read docs
there, happy
const sentences = [
"I am sorry...",
...
"Always will :heart:"
];
message.channel.send('Griffin....').then(async (msg) => {
for (const sentence of sentence) {
msg.edit(sentence);
await timeout(n);
}
}
we don't spoon feed
I know
I didnt found the commands
im not asking to
that's exactly the opposite of what we're doing though, the timeout function is the core of it
which is what you'd have to write
you could also do a recursive function if its easier to understand
¯_(ツ)_/¯
recursive function?
Did exactly what I wanted it to do
Yea
recursive fuction calls on it's self
or something like that
and it loops it i think
thats what i read it says that
//do something with var
setTimeout(function(){ abc(var) },5000)
}```
I read from there
it told me what a recursive fuction is
function*
but anyways
Thx tim ❤
I assume it closes as soon as you close putty
yes
tmux
the bot closes when i close putty
because putty is still a local terminal
you have to create a tmux session and let it run there
@earnest phoenix https://en.wikipedia.org/wiki/Tmux
how does one fix this issue
(node:23584) UnhandledPromiseRejectionWarning: TypeError: winners.map is not a function
at giveaways.map (/home/tony/Givaway[canary]/handler.js:47:78)
at <anonymous>
winners.map(w=>`${w}`).join(' ')
what is the content of winners?
install tmux on your server, create a tmux session, detach from tmux session and then it fully runs in your server
how do i create a tmux session
let winners;
if (!users.size) {
winners = 'None, nobody entered?';
}
else if (users.size === 1) {
winners = users.random(1);
}
else {
winners = users.random(giveaway.winnerCount);
}
its set there
?
in putty?
yes
winner is a string, i dont think .map() works on strings
apt-get tmux?
it shouldn't be a string
I don't remember how specifically
there were 2 users that entered
its apt get or something
so it should be an array or whatever .random gives @quartz kindle
ok
idk about .random, but in the first if, it becomes a string
so it will eventually throw that error
i have to do it in the vortex folder right?
no just in your home directory
ok
what is users?
ok @ruby dust installed it
now each time you create a tmux session it will create a terminal on vps end
const reactions = msg.reactions.filter(r => r.emoji.name === '🎉').first();
const users = reactions.users.filter(u => u.bot !== true) || null;
that
how do i create a tmux session?
tmux new -s any_name_here
is .random() a lib?
there's more tho
yes, this is where you attempt to run anything you want
thats what it is @quartz kindle math.random
not quite
also tbc this works on my public bot
you have to be able to detach from the tmux session
thats weird af
ctrl + b then press d
Giveaway needs an 'e'
ok
spelling lmao
how do i enter back
if you want to attach back to the session you do tmux attach -t session_name_here
and to kill a session tmux kill-session -t session_name_here
tmux a attaches to the first session it finds
ok tysm @ruby dust
🙌 ok
wow
anyway Tony, console log all 3 instances of winnerto confirm that they work
ye
ok new issue
(node:24561) UnhandledPromiseRejectionWarning: DiscordAPIError: Unknown Message
unknown message = message was deleted, was hidden by message history, or channel/server no longer accessible
its still there
const m = await channel.fetchMessage(giveawayId);
using that code if it makes sense
does your bot have message history permission?
then idk, was the bot restarted? did the message get removed from cache?
the bot was restarted yes
but fetchMessage is supposed to get it regardless of cache right?
yeah i checked
but if its not working then maybe the problem is elsewhere
double check if the channel and id are correct
yeah i'll console.log them
a dedicated server
like host name?
https://nexril.net/dedicated, i'm using the $50-something lowest plan
does it support windows?
me
wew prices not bad tbh
^
Well if you want any cheap and decently good ones remember to check the pins of this channel
ok
galaxygate is where it's at rn 
still not sure how galaxygate is fairing

Had been considering to switch for some time now
skysilk is where its at rn 😩
my $10 droplet is hosting all 7 of my projects rn
for cheap
my free vps is hosting all 6 of my projects rn
not mine but
LOL music bot usually don't need that much cores
inb4 discord.js music bot
@knotty steeple tell us
wat
skysilk is a sham tbh
@fluid basin well consider this a music bot needs to encode in real time and transaudio in real time too
its bw is totally crap
nah it good
when it needs more just switch
Yeah 1 cpu shall suffice for 1-2 concurrent listeners
6*
doesnt matter much tell us
There are many providers out there which allows you to upgrade your plan easily with just a reboot
free vps what kind of joke is this
joke?
my dedi free
lmao wat
stolen credit card info is my joke
:(
so anything free is a scam ok
Like I said, tried skysilk but has really bad internet
oh
well thats you
i need fast internet
1Mbps tops for me
rip you
rip us
skysilk doesnt have that bad internet
btw @earnest phoenix
yea
i have 7 projects actually
tell us
2 apis
no
sharing is not good idea
how do you think free stuff works
here have this free plan
i know how they work
it is
@knotty steeple offtopic then moves to general lol
google's free tier works very well
GCP free tier and DO $50 coupon on the GH student pack are imo the only two proper "free" hosts
How can I make
it display a users
ID
that I mention
isn't it js message.user.id ?
and I have user defined
replace user with author
you asked if its message.user.id
Ok
i said replace user in that instance with author
but then it would give me my userID
what do you want
the person who runs the command's user id?
did you not read at all what i said
Noooo
do you not read
I said
I want to be able to mention the user
and get theri ID
their*
oh um
to get a mentioned user in a message you have to do message.member.mentions.first() iirc
let user = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
already have user defined
but if I need to take anything away
i will
actually it would be user.user.id 👀
^
oh
msg.author = user, user.id etc
msg.member = guildMember, user.user.id etc
i forgot user and member are different
Does anyone know if there are any documentetion of Akinators websocket?
It has changed but I have no idea of how does it work :/

I am trying to make a command
where it searches a subreddit
for a story
like the subreddit
nosleep
it is full of horror stories
Can anyone assist me in this type of command
?
use the reddit api
they have an API
yes
var data = await client.func.userSearch(msg, {user: [user], name: this.help.name});
how coma I am getting error from this
come*
it is saying
cannot read property userSearch of undefined
client.func doesn't exist
Oh
db.updateText(`logChannel_${message.guild.id}`, newChannel).then(i => {
message.channel.send(`Successfully updated log channel to **${message.mentions.channels.first()}**`)
})
can someone help me
it is saying
db.updateText is not a function
wait
I will ask the support server for that module
well nvm
support server is messed up
So guys, using discord.js, how can you find out how many voice connections your bot has?
client.voiceConnections is a collection so you can just use client.voiceConnections.size
@sick cloud
@client.command(pass_context=True)
async def leave(ctx):
server = ctx.message.server
voice_client = client.voice_client_in(server)
await voice_client.disconnect()
i have this code to make my bot leave a voice channel when i say !leave, but it doesnt work. Anyone know why?
Can you help me diden't found how to create channel when commad can you help me ?
Hey I need help I'm making a banned words thing it's working but if I ban blabla it doesn't works if I write BlABla
make both strings lowercase and then compare them
its french sory
that will remove your case sensitivity
const errors = require("../utils_musique/errors.js");
module.exports.run = async (bot, message, args) => {
message.delete();
if(!message.member.hasPermission("BAN_MEMBERS")) return errors.noPerms(message, "BAN_MEMBERS");
if(args[0] == "help"){
message.reply("Usage: !ban <user> <reason>");
return;
}
let bUser = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
if(!bUser) return errors.cantfindUser(message.channel);
if(bUser.id === bot.user.id) return errors.botuser(message);
let bReason = args.join(" ").slice(22);
if(!bReason) return errors.noReason(message.channel);
if(bUser.hasPermission("MANAGE_MESSAGES")) return errors.equalPerms(message, bUser, "MANAGE_MESSAGES");
let banEmbed = new Discord.RichEmbed()
.setDescription("~Ban~")
.setColor("#bc0000")
.addField("Utilisateur banni", `${bUser} avec identifiant ${bUser.id}`)
.addField("Banni par", `<@${message.author.id}> avec identifiant ${message.author.id}`)
.addField("Banni dans", message.channel)
.addField("Temp", message.createdAt)
.addField("Reson", bReason);
let incidentchannel = message.guild.channels.find(`name`, "logs");
if(!incidentchannel) return message.channel.send("Impossible le channel logs éxiste pas.");
message.guild.member(bUser).ban(bReason);
incidentchannel.send(banEmbed);
}
module.exports.help = {
name:"ban"
}
@serene tide
Banned words not ban command @jagged plume
😂
pardon
fr
i said "make both strings lowercase and then compare them, that will remove your case sensitivity"
kek
making bla and BLA the same thing
How?
because it gets converted to lower case
so when you check if it's a banned word, it will be the same no matter how it's written
i.e BLA -> bla, bLa -> bla
what's your code?
Wait
``
const bannedWords = [
"fuck"
]
And
if(bannedWords.some(word => message.content.includes(word))){
message.delete()
message.reply("stop swearing");
}
Like message.content.includes.toLowerCase() ?
no, toLowerCase() is to be used on a string
message.content is the string you're trying to change
after that you can use includes()
you basically just need to swap the order of includes and toLowerCase
message.content.includes().toLowerCase() or message.content.toLowerCase().includes()?
message.content.toLowerCase().includes(word.toLowerCase())
^ content ^ lowercase version ^ includes lowercase version of bad word
np.
Yeaa it is working great
Is there anything wrong with const canvas = Canvas.createCanvas(700, 250);
TypeError: Canvas.createCanvas is not a function
Need help
what's the version of your canvas module
you're trying to use 2.0.0 syntax
sudo npm i canvas@latest
either install canvas@next or follow 1.x documentation
https://github.com/Automattic/node-canvas/tree/v1.x
wat
If my bot and accept it will have to do g!cx_off plz
to desactivate the level up and coins annonce
👀
O.o
Hmm so many bots have trivia now.. is there a trivia api that I can use?
i guess you can try opentdb.com
o thanks
there is also qriusity.com too
how can I see the multiple choices
jservice
when-in-doubt-google-it
thank I actually searched for such a thing for a while
none of the ones I found were multiple choices
not sure
{
"text": "What is the scientific name of the cheetah?",
"answers": [
{
"correct": false,
"text": "Lynx rufus"
},
{
"correct": false,
"text": "Panthera onca"
},
{
"correct": false,
"text": "Felis catus"
},
{
"correct": true,
"text": "Acinonyx jubatus"
}
]
},```
found an api
literally googled multiple choice trivia api
so i keep getting socket hang up on my discord bot anyone a reason why?
at IncomingMessage.res.on (C:\Users\Administrator\Desktop\user\node_modules\dblapi.js\src\index.js:115:25)
at emitNone (events.js:111:20)
at IncomingMessage.emit (events.js:208:7)
at endReadableNT (_stream_readable.js:1064:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)```
🤔
any ideas
@devout flicker which api was that
I'm looking how to add roles when members click on a reacton how can I do that ?
you would need a reaction collector, and then check if the user clicks on a certain reaction give them the role
hi im makeing a music bot for discord in javascript and i was thinking if someone can help
how to resize text with canvas-constructor?
hi im makeing a music bot for discord in javascript and i was thinking if someone can help just dm me in you would like to help
.setTextFont() ?
doesnt that set the font
its in their npm page
.setTextFont('28px Impact')
font-size and font-family are always in the same field with canvas
hmm ok
does anyone know how to fix this error:
{ Error: SQLITE_ERROR: no such table: userConfig errno: 1, code: 'SQLITE_ERROR' }
https://gyazo.com/229971fb2df3ef0f8f668eb0a628f3e3
do you have a table?
table and database file is different
since the file size is 0 im assuming you dont
yes i have the table
i tried to created a new database but didnt work
let me show you the code
sql.open("userConfig.sqlite");
dbl.on('posted', () => {
console.log('Server count posted!');
})
dbl.on('error', e => {
console.log(`Oops! ${e}`);
});
client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}.`) // logs in the bot
client.user.setActivity(`=>help | ${client.guilds.size} Servers`);
client.user.setStatus('dnd')
});
client.on("guildMemberAdd", member => {
sql.run("CREATE TABLE IF NOT EXISTS userConfig (userID INTEGER, premium TEXT)").then(() => {
sql.run("INSERT INTO userConfig (userID, premium) VALUES (?, ?)", [member.id, "False"]);
}).catch(console.error);
})// cuz it jsut added the file userConfig
client.on('guildMemberUpdate', (oldMember, newMember) => {
if(!newMember.guild.id === "458414150889242635") return;
if(!oldMember.guild.id === "458414150889242635") return;
let supporterRole = newMember.guild.roles.get("472408106576379924")
if(!supporterRole) return console.log("There is no Supporter Role! Please set one up for donators!");
if(!oldMember.roles.has(supporterRole.id) && newMember.roles.has(supporterRole.id)) {
sql.get(`SELECT * FROM userConfig WHERE userID ="${newMember.id}"`).then(row => {
if(!row) {
sql.run("CREATE TABLE IF NOT EXISTS userConfig (userID INTEGER, premium TEXT)").then(() => {
sql.run("INSERT INTO userConfig (userID, premium) VALUES (?, ?)", [member.id, "True"]);
})
}
sql.run(`UPDATE userConfig SET premium = "True" WHERE userID = ${newMember.id}`).catch(console.error);
return client.channels.get("471487580517695508").send(`:tada: **Thank you to ${newMember} for supporting Vortex on Patreon!** :tada:`).catch(console.error);
})
}
})
Fala aí amigos alguém fala português aí ?
Gostaria de deixar uma dica tipo
o próprio Discord ter seu Navegador igualmente o depósitivo móvel pra visualizar imagens
Com opção vídeos, YouTube, Market facebook Google etc.
What Google translate translates this to:
Does anyone speak Portuguese there?
I would like to leave a tip type
Discord itself has its Browser also the mobile depot for viewing images
With option videos, YouTube, Market Facebook Google etc.
Eu não falo português, estou usando o Google translate. Mas isso é legal. Eu sabia que tinha um navegador no celular, mas é sobre isso.
Google translate is wonderful
Idk if that is even close
it was good if the discord had its Browser to open tabs
Why many when I opened browser plus the discord more warframe the PC crashes all over
How do I find the channel my bot can send a message in?
if(guild.channels.has(guild.id))
return guild.channels.get(guild.id)
if(guild.channels.exists("name", "general"))
return guild.channels.find("name", "general").id;
return guild.channels
.filter(c => c.type === "text" &&
c.permissionsFor(guild.client.user).has("SEND_MESSAGES"))
.sort((a, b) => a.position - b.position ||
Long.fromString(a.id).sub(Long.fromString(b.id)).toNumber())
.first().id;
}```
guild.channels .filter(c => c.type === "text" && c.permissionsFor(guild.client.user).has("SEND_MESSAGES")) .sort((a, b) => a.position - b.position || Long.fromString(a.id).sub(Long.fromString(b.id)).toNumber()) .first().id;
so I have server logging, one of which is when a user changes their username and/or discrim
regardless of how many mutual servers the user has with the bot that log will only trigger in one server
can anyone explain me why it's that?
async def on_member_update(self, before, after):
if after.guild.id in logging_channels.keys():
channel = self.bot.get_channel(logging_channels[after.guild.id])
if channel != None:
if before.name != after.name or before.discriminator != after.discriminator:
embed = discord.Embed(title = 'Username Updated', color = 0x7D3C98, timestamp = datetime.datetime.utcnow())
embed.add_field(name = 'Before', value = before.name + '#' + before.discriminator)
embed.add_field(name = 'After', value = after.name + '#' + after.discriminator)
await channel.send(embed = embed)
Can you help me plz to make a progress bar with canvas
this stills gives the user access to the command heres the code any fix?
} else if (command === 'volume') {
sql.get(`SELECT * FROM userConfig WHERE userID ="${msg.author.id}"`).then(row => {
if(!row) {
sql.run("CREATE TABLE IF NOT EXISTS userConfig (userID INTEGER, premium TEXT)").then(() => {
return sql.run("INSERT INTO userConfig (userID, premium) VALUES (?, ?)", [msg.author.id, "False"]);
})
}
if(row.premium === "False") return msg.channel.send(`Sorry, you do not have the Supporter Role.`).catch(console.error);
}).catch(console.error);
if (!msg.member.voiceChannel) return msg.channel.send('You are not in a voice channel!');
if (!serverQueue) return msg.channel.send('There is nothing playing.');
if (!args[1]) return msg.channel.send(`The current volume is: **${serverQueue.volume}%**`);
serverQueue.volume = args[1];
serverQueue.connection.dispatcher.setVolumeLogarithmic(args[1] / 5);
return msg.channel.send(`I set the volume to: **${args[1]}**`);
can anyone help?
i need some help with an avatar change detector. i keep getting a 404:
12|mini-me | You have triggered an unhandledRejection, you may have forgotten to catch a Promise rejection:
12|mini-me | Error: 404 Not Found
12|mini-me | at _response.transport.request.then (/home/node/mini-me-stable/node_modules/snekfetch/src/index.js:193:21)
12|mini-me | at <anonymous>
12|mini-me | at process._tickDomainCallback (internal/process/next_tick.js:228:7)
how to make my bot check if the user has upvoted it on DBL (im using discord.py)
Bots can't accept friend requests
@earnest phoenix Are you using manual HTTP requests or the library?
library
Looks like there is no function
oh
Though you can do it manually
await <DBLClient>.get_upvote_info(days=1) returns a dict with users who voted for your bot today
client.on('messageDelete', async (message) => {
const logs = message.guild.channels.find('name', 'bot-hell');
if (message.guild.me.hasPermission("MANAGE_MESSAGES") && !logs) {
await message.guild.createChannel('bot-hell', 'text');
}
if (!logs) {
return console.log('The logs channel does not exist and cannot be created')
}
const entry = await message.guild.fetchAuditLogs({
type: 'MESSAGE_DELETE'
}).then(audit => audit.entries.first())
let user;
if (entry.extra.channel.id === message.channel.id && (entry.target.id === message.author.id) && (entry.createdTimestamp > (Date.now() - 5000)) && (entry.extra.count >= 1)) {
user = entry.executor.username
} else {
user = message.author
}
const logembed = new Discord.RichEmbed()
//.setTitle('Message Deleted')
.setAuthor(user.tag, message.author.displayAvatarURL)
.addField(`**Message sent by ${message.author.username}> deleted in ${message.channel.name}**\n\n`, message.content)
.setColor(message.guild.member(client.user).displayHexColor)
.setFooter(`<#${message.channel.id}>`)
.setTimestamp()
//console.log(entry)
logs.send(logembed);
});```
@dull breach
just try console.log("1") and over after every line of code
then you ll find where code breaks
that seems inefficient
Okay...
lol
@hollow abyss
and that console.log never happen cuz error somewhere in the middle
k
what of it
The website.
what of it
https://cdn.glitch.com/88b80c67-e815-4e13-b6a0-9376c59ea396%2Fimage.jpg?1532271294182
this ping @hollow abyss
p much
How do people make the login with Discord thing?
Step up your game with a modern voice & text chat app. Crystal clear voice, multiple server and channel support, mobile apps, and more. Get your free server now!
Best get reading
K.....
You should use passport.js
I have a command to change a user's nickname: ?nickname [nickname] {@player}, but every time it is run I get the following error:
(node:8109) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 18): DiscordAPIError: Missing Permissions
My bot has the 'bot' role, which is the highest in the hierarchy and has all permissions. It can't even change the nicknames of players who aren't the owner of the server!
Here is my code:
module.exports = {
name: 'nickname',
cooldown: 60,
description: 'change nickname',
execute(message, args) {
const changeNickTo = args[0];
const member = message.mentions.members.first();
if(changeNickTo != null) {
if(member != null) {
message.channel.send('Changed ' + message.mentions.users.first() + "'s nickname to **" + changeNickTo + "**.");
message.member.setNickname(changeNickTo);
} else {
message.channel.send('You just changed your nickname to **' + changeNickTo + '**.');
message.member.setNickname(changeNickTo);
}
} else {
message.channel.send("Please provide a nickname that you'd like to change to!");
}
},
};
@hollow abyss i personally use
https://www.npmjs.com/package/passport-discord
https://www.npmjs.com/package/passport
its pretty easy to setup
and they have lots of packages for most major services oauth
Ah well. If anyone uses Node lmk thx
Though its more of a permission issue
seems like the bot doesnt have permission
Yeah
so check if it does?
so it doesnt have perms
yeah but
lol
Trying to change a nickname
wait
looking at that screenshot bot role is above everyone else
Yeah
doesnt matter in this case since the bot role is top position
im not sure it will work if you're doing it to yourself
It doesn't work for other players either.
Let me try that
it would be trying to change your nickname
that was the problem
message.member would be trying to change ur nick
Hey! Do you also know how to remove a nickname
thats what i said smh
OK
Sorry
Accident 😆
@topaz fjord that didnt work
its actually member.setNickname('');
same difference
Yes
how to fix problem with canvas-constructor rendering emojis as boxes
You probably didn't have that variable and you tried
i dont have to use canvas if i dont want to
and technically im already using canvas
as canvas-constructor requires it
is that canvas?
no
im confused
ok
anyway can someone help me
@knotty steeple you have to preload any fonts you're using
node-canvas 2.x.x has a font preload function
idk about canvas 1.6
does Luca show the uptime of other bots?
for music command how would you loop the song/playlist?
-bots
@pulsar monolith
@restive wolf
-bots @marble tree
@hardy burrow
@pulsar monolith

Don't use Luca in here
Okay, understood.
@earnest phoenix no
@earnest phoenix after the song in the queue /playlist is done read it to the queue
I need help is anyone here
@earnest phoenix what you need helpwith?
Im using giveaway bot
For some reason
if you asking about another bot look on google
The giveaway didn’t end
alot of sources on google
The bot redirected me here
:/
send pic of it saying it redirected you here
Okay
Can i giv link here
send a pic
not a link XD
and links are not available here
lol
join discord mean this server
it didnt redirect you here
XD
Yesh it redirected me to this server?
Anyway even if its not your bot can you help me our
The page just has 4 commands but no command to end thr giveaway
ill give you the solution
😦
Tried
That’s the first thing people do
This is not the support server for giveaway bot. You can usually find the support server on their bot page
^ @earnest phoenix
^ @hearty storm
Okay i've been just barely scraping by on mysql with my bot and even somehow it works and i use the same code and im honestly super confused connection.query("SELECT * FROM banned_users(ticket) WHERE user-id = " + message.author.id, async function (err, rows) { what is wrong with this, rows is undefined and i just have no clue how to pull data from it
@slim heart
connection.query("SELECT * FROM banned_users(ticket) WHERE user-id = ?", message.author.id , async function (err, rows) {
i just tried that aswell same error
also are those rows and table names valid 
have you print the value of error?
if it exists
is err defined at all?
aka is there an error
also by the looks thats workbench so if you manualy filled that info have you clicked apply?
?
3306 is mysql normal port
so guessing you only jsut now checked if err was defined 😛
im faily certain that due to the - thingy
cause normally you dont use - in a row name
- it is that
just noticed the row nam it was trying
make the row call user_id
the open bot is only in a test group for now
btw your token is public
yes i know
i suggest you change it
just dont leave your token in there
i removed the token
Okay so what do i do when stuff isnt defined in the mysql array it just completely stops
I want it so its like a banned user kinda thing
so i can add things and if rows[0].banned == 1 then it returns
but then it just says its not defined no matter what
how do i make it so if its not there it just continues
@shy rose
i have just put some stuff you can edit this a any time
@earnest phoenix can you not post the same link again and again
also its an empty project maybe have a look around github and get some ideas dont copy/steal
that too
Chewey what do i do?
alright perfect :D thank you
and if you slap an else on then just means no results found
ok talk later
jbp if you need any more help just ping just gonna minimise discord
My bot is broken! Someone help pls
What is the issue?
Well what is the error?
Can't help you then.
@earnest phoenix, sounds like a GiveawayBot issue - best to ask in their support server or use my giveaway bot.
What's yours
I need help,
client.on('message', msg => {
if (msg.includes('KYS');
msg.delete()
msg.author.send('Do not tell people to kill themselves, it\'s rude.')
});```
Trying to ban "KYS" but my bot doesn't block it, can someone help me? [ Ping me while replying, kthx. ]
@obtuse wind
Can you explain the second line?
if the the message includes "KYS" then the bot should delete it and send the author a DM
ok, but msg is a message object, not a string so .includes will not work.
you using discord.js?
Node.js / Discord.js yah
OK, so go here https://discord.js.org/#/docs/main/stable/general/welcome
then click "message" on the side
mkay
ok, now look at the "properties"
you need the one that contains the content of the message
so you click "content" in the list and it scrolls to
so msg.content would be the string that you need to check with .includes
so msg.content.includes or just msg.content?
well msg.content is a string, and the syntax for .includes is
👍
Also, your syntax for the if statement is wrong, so you might wanna look up an example for that
ok
how to change this Color?
use CSS
how do i get it
put <style> ... </style> in your bots long description
Oke
@sick cloud are you able to remove bots from the site?
https://discordbots.org/bot/303710071387324416
An old instance of my bot is still there but it's been offline for a while, any chance you could remove it. I can provide more proof of ownership is feeded
You can remove it yourself by going to the bot page and clicking Delete @earnest phoenix.
it's under an old account
I lost access to it after losing my 2fa recovery code
@sick cloud
Ah, alright. Send me the proof of ownership you have in direct messages then.
wha
nope * xD Tony Bamanaboni
help please
glitch 
@earnest phoenix for what do I must change ... on glitch ?
const config = require (../../config.json)
remember it has to be a string
how to make "Click here" like this
so should i search for hyperlink ?
if it doesnt work its the other way around
i will try it by myself first
:triggered:
how does a daily command work, as in a command where people upvote your bot, and get a reward for it. how to make it so my bot knows when a player upvotes?
webhook or use the check endpoint
Well you need to learn if if you want to do it
You can use inspect element to get classes and ID's and you can then change the properties of them, like color
🤔
I know in discord.py there is a way to check if a user follows permission hierarchy, but I can't seem to find it
like I don't want to manually build permission check like for example check role hierarchies if a user can ban that user or not
I simply do
if ctx.author.top_role < member.top_role:
return await ctx.send(lang['ban_3'])
but relying on top roles is not the best option
I remember async has a built-in option that checks that properly
Isnt there something like has_ban_permission or something
a permission check decorator?
I know jda just has booleans if(user.permissions.BANPERMISSION) idk if there is something like that in python tbh
checking if a member has a permission is one thing, and checking if a user can use that permission on a target member is a different thing
In java that throws a exeption so idk what thats like in python sorry
Ik pretty new to python
i get (node:4) UnhandledPromiseRejectionWarning: Error: 403 Forbidden Error every two attempts to get random cat img
it work time
and log this error time
mention if you have help
what api?
discord.js
no i mean cat api
discord.js isnt a api 👀
i see
ooooooooooooooooh
just a sec
let catImg = (await snekfetch.get("http://aws.random.cat/meow")).body.file;```
did u fix it
so that will work ???
(node:2296) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'Agent' of undefined
(:
mr derpy ...
@neat falcon
yeah
where you have that
in the console 👀
theres no any agnet word in the code
can you send the full command code please?
here ?
yes
const Discord = require("discord.js");
const snekfetch = require("snekfetch");
module.exports.run = async (client, message, args) => {
let catImg = (await snekfetch.get("hhttps://nekos.life/api/v2/img/meow")).body.file;
if (!catImg) return message.channel.send("Erorr: can't find any cat.\nDM the bot if this error continued");
const embed = new Discord.RichEmbed()
.setTitle("Meeeow")
.setColor('RANDOM')
.setImage(catImg)
message.channel.send({embed});
}
module.exports.help = {
name: "cat"
}
ik

```bot.on(guildMemberAdd, member => {
let listedusers = (432876205641826309, User2, User3, etc);
if (member.id = listedusers) {
const lChannel = member.guild.channels.find(`name`, `anti-raid`)
lChannel.send(`${member} a été banni car il figure sur la liste des raideurs connus.`)
member.guild.ban;
}
})```help please it does'nt ban the user
@limpid cosmos Can you explain line 2 and 3?
if the id from the new member guild = 432876205641826309
then if the id from the user = id from the list -> ban this user
do you know what an array is?
yep
ok well your syntax on line 2 is not an array
how do i must change it ?
[] instead of ()
witch line ?
okay
Ok, also on line 3 you are using 1 = instead of 2, so you are not comparing
member.guild.channels.find('name', 'anti-raid')?
bot.on("guildMemberAdd", async member =>{
and you are also comparing an id to an array, so that will not return true
also do you always use ``
yep or sometimes ""
so, you might want to check if the list includestheir id, so... https://img.69420.me/bYmOIBX0.gif
its only really needed for template literals
but 
i recommend you read up on javascript arrays also to see more
i use sharex, screenshot/screen recording tool
okay
help
Error: Cannot find module 'canvas-prebuilt'
whatever could that mean 🤔
Maybe the module called "canvas-prebuilt" cannot be found. did I install it?
I did
install
in right directory?
How can I change the picture's shape in my bot's page?
css
https://www.hastebin.com/weyutejoza.coffeescript <---- can someoe help me with this error I do not understand what ./test.js is
it cant find the test.js file in your project
you probably have require('./test.js') in your code
with discord.py, if I want to check if a role has ban permission, do I go with if ban_members in role.permissions or if role.permissions.ban_members?
My bot is answering to any prefix i use
but I only want it to answer to !
how can I fix this?
let prefix = botconfig.prefix
let messageArray = message.content.split(" ");
let cmd = messageArray[0];
let args = messageArray.slice(1);
let commandfile = bot.commands.get(cmd.slice(prefix.length));
if(commandfile) commandfile.run(bot, message, args);
here is my code
How would i do that though
cause up until now
the bot only answered to !
idk why it has changed
Because you never check if the message started with !
your code snipped up there would trigger on any character that has the same length as !
So I would have to go through every command file
so effectively !ping and aping are handled the same
and make it check if it started with the prefix
No you could check that before even running a command
just do it on your basic message handler
let prefix = botconfig.prefix
let messageArray = message.content.split(" ");
let cmd = messageArray[0];
let args = messageArray.slice(1);
if(message.content.indexOf(prefix) !== 0) return
let commandfile = bot.commands.get(cmd.slice(prefix.length));
if(commandfile) commandfile.run(bot, message, args);```
... why
Sorry
I did not mean to do that ><
I meant to do a heart
the middel finger and heart
are next to each other on the most resent
Thx ❤
How do you make a help command with the next page option with adding a reaction?
Pagination
?
you listen to reactions and edit the message xD
you need to code it, it isn't as simple as calling a function
but it could be 👀
Error: listen EADDRINUSE :::5000
any reason i get this error after doing an npm upgrade?
Port being already used? 
nope i fixed it with a system restart that was weird
throw err; // Unhandled 'error' event
^
Error [ERR_UNHANDLED_ERROR]: Unhandled error. ([object Object])
at Client.emit (events.js:171:17)
at WebSocketConnection.onError (C:\Users\User\Desktop\LewdGoddess\node_modul
es\discord.js\src\client\websocket\WebSocketConnection.js:374:17)
at WebSocket.onError (C:\Users\User\Desktop\LewdGoddess\node_modules\ws\lib\
event-target.js:128:16)
at WebSocket.emit (events.js:182:13)
at _receiver.cleanup (C:\Users\User\Desktop\LewdGoddess\node_modules\ws\lib\
websocket.js:211:14)
at Receiver.cleanup (C:\Users\User\Desktop\LewdGoddess\node_modules\ws\lib\r
eceiver.js:557:13)
at WebSocket.finalize (C:\Users\User\Desktop\LewdGoddess\node_modules\ws\lib
\websocket.js:206:20)
at TLSSocket.emit (events.js:182:13)
at emitErrorNT (internal/streams/destroy.js:82:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
'bot.guild.size' is not recognized as an internal or external command,
operable program or batch file.
Press any key to continue . . .```
can someone pleaswe help
discord.js?
this is effecting my whole bot
ye
discord.js
every time my bot is shutting down
because of it
<Client>.on("error", err => {
console.log(err)
})
add that and wait for it to come back
in my index?
yes
but the error is literally [object Object]
nah
thats what i got when i had my error handler
it says unhandled
handle it and it will show u what it is
at least thats what they tell me in the discord.js server
idk it didnt
it's [object Object] if you stringify it
instead of doing something like
console.error(`Caught error: ${error}`);
do
console.error('Caught error', error);
the latter won't stringify the object
oh

