#development
1 messages · Page 864 of 1
what language?
its got nothing to do with the language
refresh compass? You always have to refresh it
i am, still nothing
i still need help with my bot not sending anything
Like, click on something else then click back on the document
oof
Are you sure you're checking all pages?
only the page im using
have you tried restarting compass?
whats the code
hm
@ripe lantern replace bot.say with ctx.send
ah ok
I think you are just filtering the guild, not updating anything
i copied and pasted from my prefix command and just changed the stuff for the db
Last time I used mongodb I used await this.collection.updateOne(query, {$set: newValuesObject}); but I haven't used it a long time
restarted compass but still
since i cant fetch more than 100 messages can i fetch 100 then use the oldest as the before parameter of another fetch?
how do i add an embed command?
Anyone know why bots aren't able to use animated emotes anymore?
Yes Cyber
ok idk what i done wrong but i just copied and pasted the prefix to the welcome channel thing
awesome
it works
also
module.exports = async (client, member) => {
const guildS = require('./models/Guild');
let guild = await guildS.findOne({ id: message.channel.guild.id });
const channel = guild.welcome.channel;
const message = guild.welcome.message;
const serverName = member.guild.name;
const size = member.guild.memberCount;
const username = member.username;
client.createMessage(channel, message);
};
``` that is how you set variables right?
I mean in the code you provided most of the variables are unnecessary but I guess yeah? You can just do client.createMessage(guild.welcome.channel, guild.welcome.message);
Like {user} is the name of the user who joined?
You would use the .replace function to replace {member} with the name of the member
no
o
Anyone know why bots aren't able to use animated emotes anymore?
Mine can iirc
You are probably doing something wrong
yep, my one can as well
also
with eris, how do you edit a message after, lets say, 5 seconds?
Is good idea to use Kotlin + Spring Boot + Hibernate REST backend API for Rust discord bot?
@digital ibex use setTimeout() and probs make a little function to edit it
kk, ty
Mhm
@cinder patio pm2 still broken
oof maybe you've enabled cluster mode?
though idk if that would be the reason why...
@golden condor do pm list
pm2 list*
Ok
can you do it in the console
It just shows sends :emotename:
Bot have access to the emote?
yeah
Like is it in a server the bots in
Probably emote specific
I’m not really sure
You can try deleting the emote and readding it if you have access to it
@cinder patio not on pc atm
nope, Didn't work
oof, wait let me see all the messages
Ok, I guess you can do pm2 delete bot, though I doubt it would fix it since it's errored
Yeah ik
Try restarting the script pm2 restart index
That's weird
@golden condor you have 2 instances of your bot running.
Running exec, will run twice as well...
Try restarting your VPS if you can
pm2 stop all -> pm2 delete all -> pm2 start <appname>.js
but then you'll have to start it again and you said you can't access the console
@twilit rapids I've tried
Not on my pc atm anyway
It's so annoying
It starts with one instances
Then shows two
Please help
I'm going crazy
The only event that runs twice is message
seems like a problem with your code then
hi
so
uh
in my guildMemberAdd event, i have this let guild = await guildS.findOne({ id: member.guild.id }); to get the guilds message and channel id
My new Raer Mouse Mats has blinked
and uh
Would that be ok @cinder patio, can I DM you later with my code?
why insn't member.guild.id working?
yea sure
Can someone walk me through how to get a user.username from a mention, (keeps saying undefined.)
v11.6.1, not v12.1.1 ::discord.js, node, windows 10 etc
Kk thanks
Toxic, show us how you're doing it first
@obtuse wind have you looked at MessageMentions yet?
@obtuse wind message.mentions.members.first().user.username
^ that but with less spoonfeeding
mentionedUser.username
What is mentionedUser defined ae
That's how you get the username of the first user mentioned
Is message.mentions.members.first() is what mentionedUser is?
If so
mentionedUser.user.username
so basically I'm trying to pull their username in the mention and put it in a JSON file
( like my warnings.json );
mentionedUser.user.username
Is message.mentions.members.first() is what mentionedUser is?
let mentionedUser = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
for my warn command; I want to have their username put into the warnings.json file
I just put multiple = in that
Kk
uh
any ideas why this is happening?
its for the guidlMemberadd event and uh
idk why thats happening
turn your bot off.
why?
Before it pings discord's tos
You shouldn't do tbat
its stopped
It's across all guilds
Your bot may not spam in multiple channels, guilds; it'll get ur bot banned
The guildMemberAdd event is across all guilds
yeah like turn it off and keep it off for a while
and reprogram your guildMemberAdd listener
i mean
if you want help on reprogramming your guildMemberAdd I will help you, but your bot must be offline because its no use programming a banned bot
thank you please show me your guildMemberAdd listener
const guildS = require('../../models/Guild');
let guild = await guildS.findOne({ id: message.channel.guild.id });
const channel = guild.welcchan;
const Message = guild.welcmsg;
client.createMessage(channel, Message);
hmm
client.on("guildMemberAdd", async member => {
let logchannel = member.guild.channels.find(c => c.name === `channel-name-here`); //case Sensitive; must be lowercase, with dashes, in order to get channel name
if(!logchannel) return;
logchannel.send(`${member} has joined, welcome!!`)
console.log(`\n AUTOMOD: ${member.id} has joined ${member.guild.name}:${member.guild.id} : Time: ${member.joinedAt}\n`);
});
```~~~
do something like that
change your listener to something like that
no...
that way its posted ONE TIME on a certain channel
You want to let the user pick the channel?
The channel is easy
well then ignore me.
Toxic, they are using eris, not discord.js
Ohhhhhhh
but its sending it in every server when one person joins
toxic, u can't do ur way for the way i am doing mine
how can i make it not send loads of messages and make it only send when its in that server that someone joined
not another one
its nested, but
that is my whole code
its nested but, im using a handler and i've got no idea why its sending loads of messages
how do I create a command that makes an embed?
i understand its nested with the message event because i wanted to be able to use message to get the guilds name + id but idk
blaine
uh
in python 3.6
@ripe lantern which library
how do I create a command that makes an embed?
@ripe lantern
you make a command that sends an embed,
what version are you using
1.3.3
sigh
i think so
in python 3.6
idk it just seems odd to me
ok
let vwarnEmbed = new Discord.RichEmbed()
.setAuthor(`Verbal Warning`)
.setDescription(`optional desc`)
.setFooter(`optional footer.`)
.setColor(`#f76707`)
.addField(`something here`, `something`, true/false)
.addField(`something here`, `something`, true/false
@ripe lantern if you can translate that into python, you can use that as an example
neat
I said if he can translate that into python.
now how do i add the body and color of the embed
(<send>{
embed: {
title: 'this is a fancy title',
color: 0xcolor,
description: 'this is a description'
}})```
thanks!
no worries
field is an array of objects in js
not sure about python
IK
i wasn't talking to you
so how do i put dat into a command
.
neat
just say ur prefix test and see
so < instead of test?
oh
client.users.cache.get
how do i keep a discord bot online?
@ripe lantern you need a host
most hosts you have to pay for
but i know a good free host
what is it?
free hosts are bad
me again talking about it
loc isn't
since december, i've been using them and they've only had one time when their services are actually down
dang
Getting this error in #commands ```js
0|index | DiscordAPIError: Missing Access
0|index | at RequestHandler.execute (/home/cxllm/Bots/Corynth/node_modules/discord.js/src/rest/RequestHandler.js:170:25)
0|index | at runMicrotasks (<anonymous>)
0|index | at processTicksAndRejections (internal/process/task_queues.js:97:5) {
0|index | name: 'DiscordAPIError',
0|index | message: 'Missing Access',
0|index | method: 'post',
0|index | path: '/channels/697061184708280350/messages',
0|index | code: 50001,
0|index | httpStatus: 403
0|index | }
0|index | DiscordAPIError: Missing Access
0|index | at RequestHandler.execute (/home/cxllm/Bots/Corynth/node_modules/discord.js/src/rest/RequestHandler.js:170:25)
0|index | at runMicrotasks (<anonymous>)
0|index | at processTicksAndRejections (internal/process/task_queues.js:97:5) {
0|index | name: 'DiscordAPIError',
0|index | message: 'Missing Access',
0|index | method: 'post',
0|index | path: '/channels/265156286406983680/messages',
0|index | code: 50001,
0|index | httpStatus: 403
0|index | }
what are you trying to do
pls help wtf
i just want to get all attachments sent in a channel
and by all i mean all, not just the ones in the first 100 messages
That would be API abuse (if you want to fetch ALL messages in the channel)
even if i add timeouts so i dont bypass ratelimits?
plus we are talking like 500 messages in total
hi, if i have an event, how can i make that event work only for that server? like, when a member joins, it sends the message to all servers a welcome channel has been set?
I mean, if you fetch every maybe 20-30 seconds then it wouldn't be, also you can fetch max 100 messages, so put 100 instead of 50 so you make less requests
Use an if statement Officially lost
i know i can fetch 100, forgot to change it back to that after debugging
but that still doesnt answer my question 
cache gets console logged before the async function has finished executing
what would i put in it?
right but im getting 2 fetching... logs while the channel has 300 messages
kk
with 50 and with 100 as the limit
so that is not the only issue
lmao so adding await fixed everything
const guildS = require('../../models/Guild')
const guild = await guildS.findOne({id: message.channel.guild.id})
if(messaage.channel.guild.id !== guild.id) return;
u think something like that?
i dont think so bc it is looking for the same id?
yea

messaage.channel.guild.id != guild.id will always return false
does this command work?
await bot.send(embed:
{title: 'oop',
color: 0xcolor,
description: 'test'}))```
const guildS = require('../../models/Guild')
const guild = await guildS.findOne({id: message.channel.guild.id})
if(!messaage.channel.guild.id !== guild.id) return;```
make a logs command and only send the messages to that channel for that servers moderations not some other random one
okay well you are comparing a guild IDs, make sure to compare channel IDs instead
where is this code executed? In which event?
guildMemberAdd
so, would it be like
const guildS = require('../../models/Guild')
const guild = await guildS.findOne({id: message.channel.guild.id})
if(message.channel.guild.id === guild.logchan) return;
but wouldnt that just send it to every server which has a logs channel?
I don't understand why you want to compare the IDs of channels / guilds? You can just send the message to the channel: client.sendMessage(guild.logchan, "...")
You want to restrict it to a specific guild? Let's say your bot's guild?
yeah
ookay then you would compare message.channel.guild.id with the specific ID of the server
example: message.channel.guild.id === "264445053596991498" This checks if the message was sent in DBL for example
if i delete a message in this server, and my bot is in this server, it will also send it to my server
yeah but i can't hardcode in every server 
Uuh depends on how you do it... can you show how you're sending the message
ok, look uh
before i had my database set up
i made a few logs commands
and uh
they failed because there were logs from other serves coming into my server
so, i had to do this js client.on('messageDelete', (message) => { if (message.channel.guild.id !== '650128487511883796') return; client.createMessage('686997585541726264', { embed: { title: 'Message Deleted', color: 0xdb1a1a, author: { name: ` | ${message.channel.guild.name}`, icon_url: message.author.avatarURL }, description: `A message was deleted by ${message.author.mention} in ${message.channel.mention}.`, fields: [ { name: 'Message Content', value: message.content } ], timestamp: new Date() } }); });
but again, i can't hard code in every server :/
well, if you use client.sendMessage(guild.logchan, "Some message") that will send the message in the guild's logs channel, and only there
yeah... I'm still not sure what your goal is.. isn't that the purpose of a logging channel
what is the author thingy?
thats my thingy rn, if i delete a message in server 1, it will send it to the logs channel in server 2
sorry if im not explaining it very well, i haven't slept
blaine, thats a different langauge
No.. client.sendMessage(guild.logchan, "Some message") won't do that, it will send the message in the guild where the message was deleted., unless you have some other code which does what you say
i just tried that, my friend joined the server to test and it sent the message in both servers
both do have a welcome message set
and it sent two different things, the welcome message
if i remove this if statement, it'll send every deleted message from every server my bot is in to that channel
how do i put an image into code?
like when my bot says something with an image in it
ok
so I have a method in my class http://alex.is-bad.com/82ziTkL.png
should I leave it as a method or is it better to turn it into a getter
Heya, is there a way to check who upvoted via API?
i just updated to discord.js 12.1.1 and it's not working anymore
can anyone help
message.guild.channels.cache.find
try it
member.roles.add
Please look at the documentation from now on cause there are a lot of changes https://discord.js.org/#/docs/main/stable/general/welcome
let f = "i am trying something..."
I wanna get all the characters after "am" so how can i get that?
@charred jetty which lang
how would you create a blacklist command?
Js
if the user is blacklisted, they can't use any commands?
Regex
aw shit
Or find index of "am" in the string and choosr everything after
@charred jetty .split("am")[1]
ok, im not doing regex
I wasn't talking to you

ok, i've forget making a blacklist command now
how would i create variables for a welcome message? like with some bots they have welcome to {server}, {member} would output welcome to dbl, @OfficiallyLost™#3484
no
thats how it shows
string.replace("{memer}", member)
Or string.replace(/{memer}/g, member) to match all cases of {member}
Message.replace('{member}', member);
Message.replace('{size}', member.guild.members.size);
Message.replace('{username}', member.username);
//etc
``` like that?
ok, thats wrong
That's literally what i said
``
@round glade
it seems like you used a simple string
@round glade
Let me put my 5 pointless cents in
I have a right of word because my role is superior 
i confusion
no, they have a welcome message from a database and they want to replace {member} with the member who joined
how do template literals help here
Is it in the guildMemberAdd event?
I didn't read that
Have you defined member to the arrow function?
yeah
¯\_(ツ)_/¯
replace doesn't modify the string itself, it returns a new string with the replaced words
i don't mind using ${member}
Then use it?
const finalMessage = Message.replace('{member}', member).replace('{size}', member.guild.members.size).replace('{username}', member.username);
i did
the Message...
It needs to be inside two `
no what
`${member}`
this is literally it
module.exports = async (client, message, member) => {
const guildS = require('../../models/Guild');
let guild = await guildS.findOne({ id: message.channel.guild.id });
const channel = guild.welcchan;
const Message = guild.welcmsg;
client.createMessage(channel, `${finalMessage}`);
};
that my whole guildMemberAdd file
and where do you define final messagwe
Where is finalMessage defined?
i was just doing that and i just shown u
just saying wot i've got so far
im adding it now
okay cool
https://discordapp.com/channels/264445053596991498/272764566411149314/698844596825751592 add it after you've defined Message and you should be gucci
module.exports = async (client, message, member) => {
const guildS = require('../../models/Guild');
let guild = await guildS.findOne({ id: message.channel.guild.id });
const channel = guild.welcchan;
const Message = guild.welcmsg;
const finalMessage = Message.replace('{member}', member)
.replace('{size}', member.guild.members.size)
.replace('{username}', member.username)
client.createMessage(channel, `${finalMessage}`);
};
``` there is is :D, also uh
btw, how do you call that file?
show where you use this file
How is message defined?
In the guildMemberAdd event there is no message
ik im nesting events
you're what...
But what message would you got from a member joining?
because
Tf
nesting events is a recipe for disaster
in eval its just
yeah
but when i define guild as await guildmodel.findone({id: member.guild.id})
i get an error
can't read property of id of undefined
so
Where?
the member that you receive from the memberAdd event is never sent to your file
okay
module.exports = async (client, message, member) => { //here
const guildS = require('../../models/Guild');
let guild = await guildS.findOne({ id: message.channel.guild.id });
const channel = guild.welcchan;
const Message = guild.welcmsg;
const finalMessage = Message.replace('{member}', member)
.replace('{size}', member.guild.members.size)
.replace('{username}', member.username)
client.createMessage(channel, `${finalMessage}`);
};
no
No
the client.on("guildMemberAdd")
Why is message defined there
oh uh
not this
i don't have that
...
This is event handler, I guess?
yeah
where do you define the event?
In the filename, I’d guess
show how you define the event, how you get the data from client to pass it to that file
that file doesnt work by itself, it needs to be executed by something else
where are you executing it? or binding it?
jesus christ WHAT
you're killing you own bot
ik it should be
Tim's about to go crazy
like wth is this
no
there is no message lol
Message can’t be defined when there is no message
just... look, im gonna explain to you what your code is doing
xD
ik, when a message gets sent, it sends another message because its in the messag eevent?
Dafuq is going on here?
- you receive a message
- you load all events and connect them to client
- you receive another message
- you AGAIN load all events and connect them to client AGAIN (you now have 2 copies of ALL events)
- repeat the above for EVERY SINGLE MESSAGE you receive
in 500 messages you have 500 copies of all events running
ok uh
xD
What?
ok uh
when i do let guild = await guildS.findOne({ id: member.guild.id }); i get the error: 'can't read property of id of undefined'
so, idk what to do
apart from nest it
ok, i should not have said that
dude
events should NEVER be nested, because they have absolutely 0 relationship to each other
its useless to nest them anyway
you will still not have a message object on a guildMemberAdd event even if you put it in the message event
Does anyone know if there is an api/npm package or something to post guild count to multiple bot lists?
first, all your events must be defined separately
so set your event loader outside of any other code
then you need to correctly pass the event arguments in your bind function
Im checking for the Permission Manage Roles for both < Bot and me >
The Role will be add to the User but then this warning comes.
@digital ibex are you following this? https://anidiots.guide/first-bot/a-basic-command-handler#main-file-changes
then it should work if you just put that code outside of the message event, and remove the message arg from it
How would I use webhooks from an external site
without a library
Just from any website
if you want to receive webhooks, you need to setup a webserver, like express.js or something
then you create the url endpoints to handle the webhooks, and give those websites your urls
Anyone got advice for what system specs for a new bot should be?
Using Kubernetes and don't want to over pay for the specs
also weighing up a few options so wanna know if it's even worth it for some
depends on the size of the bot, and how you handle caching
and whether you use intents
we don't cache any more that JDA does, and we won't be using either intent
also the size isn't a large factor atm, looking for what i should be aware of when it comes to scaling
Do you guys use libraries when parsing commands?
im not sure about how JDA's caching works, but in general you should expect a few hundred MB of ram per thousand guilds
using a private one currently which is fairly good with memory usage
i'll show my grafana dashboard
sitting around here for users
Is it hacky to use regex?
not using intents will increase cpu usage, but depending on how JDA uncompresses discord packets, the cpu usage shouldnt be a problem, you can expect about 1-2% cpu usage on idle per thousand guilds
as for network requirments, make sure you get an unmetered connection
as you can expect several tens of gb per month per thousand guilds (or even hundred gb/month)
@limpid leaf depends on what for, its hacky if there are better tools for the job, not hacky if used for the right job
are you familiar with discord intents?
to a certain extent yea
not using them will simply enable ALL intents, so discord will send you everything they got
oh i see
the worst offender is presence update packets, which will come in hundreds per second depending on user count
which does put a strain on cpu to uncompress them in real time
intents can be used to disable the events you dont require
@digital ibex are you following this? https://anidiots.guide/first-bot/
@quartz kindle Me Too xD anddiscordjs.guidexD
if you want to receive webhooks, you need to setup a webserver, like express.js or something
@quartz kindle like when it receives say /webhookexample as a post
bot is defined right?
yes
What version of djs?
12.1.1
1 second
it was working in 11.6
do you need to apply for intents?
Yes, I think so.
follow up question, if you disable an event, will it still pop up in raw?
Ehh, wdym?
in v11
it worked
module.exports = (client, message) => {
const Discord = require("discord.js")
client.on("voiceChannelJoin", (member, channel) => {
let logger = client.guildSettings.get(message.guild.id,"logs")
let voiceChannelJoin = client.guildSettings.get(message.guild.id,"voiceChannelJoin")
if(logger === "null") return;
if(voiceChannelJoin === ":x:") return;
const salon = message.guild.channels.cache.get(logger);
const Embed = new Discord.MessageEmbed()
.setAuthor("Salon rejoint")
.setDescription(`Le membre ${member.user.tag}, viens de se connecter dans le salon ${channel.name}.`)
.setFooter("Agathe par !Zerio.js#7632")
.setTimestamp()
.setColor("ORANGE")
salon.send(Embed)
});
}
my bot is in 1800 servers no thanks
Why the spam bot in the living room ?
uh
What's the error @tender silo?
None it just spam in the lounge configured
Is that an event inside an event?
Yes
Why?
fs.readdir("./events/", (err, files) => {
if (err) return console.error(err);
files.forEach(file => {
const event = require(`./events/${file}`);
let eventName = file.split(".")[0];
console.log(`[⌛️] event ${eventName}, démarré.`);
client.on(eventName, event.bind(null, client));
});
});```
Ofc it will spam
I have the voicechanneljoin.js file in the events folder
Well, why is the event inside the message event?
module.exports = (client, message) => {
const Discord = require("discord.js")
client.on("voiceChannelJoin", (member, channel) => {
This??
Wth
Hm
Voicechanneljoin.js file in the events folder
Why do you define message then?
module.exports = (client, message) => {
const Discord = require("discord.js")
client.on("voiceChannelJoin", (member, channel) => {
this must be changed with
const Discord = require("discord.js");
module.exports = (client, member, channel) => {
If I'm correct
Okay
hello, who can work with heroku?
discord.js version?
12.1.1 😄
Oh, right ( I got bad memory) xD
Does it have permission to the voice channel?
also, VoiceChannelextends GuildChannel
const Discord = require("discord.js");
module.exports = (client, member, channel) => {
const Discord = require("discord.js")
client.on("voiceChannelJoin", (member, channel) => {
let logger = client.guildSettings.get(member.guild.id,"logs")
let voiceChannelJoin = client.guildSettings.get(member.guild.id,"voiceChannelJoin")
if(logger === "null") return;
if(voiceChannelJoin === ":x:") return;
const salon = member.guild.channels.cache.get(logger);
const Embed = new Discord.MessageEmbed()
.setAuthor("Salon rejoint")
.setDescription(`Le membre ${member.user.tag}, viens de se connecter dans le salon ${channel.name}.`)
.setFooter("Agathe par !Zerio.js#7632")
.setTimestamp()
.setColor("ORANGE")
salon.send(Embed)
});
}```
= spam
You gotta remove
client.on("voiceChannelJoin", (member, channel) => {
and }); at the bottom
yes it have permission
VoiceChannel extends GuildChannel
the worst offender is presence update packets, which will come in hundreds per second depending on user count
which does put a strain on cpu to uncompress them in real time
@quartz kindle if i use a raw event, will v11 disabledEvents still emit the event?
Try it and see?
Thx @elder vine ^^
i cant just try it
No problem.
VoiceChannel extends GuildChannel
@elder vine i don't understand should i replace VoiceChannel with GuildChannel :?
No
(my english is bad sorry btw)
No problem :)
This is what happens if the page scrolls down while the bot is typing a response. Embed message. discordjs
What should I do to avoid this?
When we enter another channel and click on this channel again, fixed this message
What do you mean?
That's an issue with Discord I believe.
@grizzled raven yes
@quartz hill this is a bug with discord mobile, but it only happens if the embed has no author field
if you add the author field to all embeds it wont happen anymore
yes
thx so much
oh wow
now i dont want to use raw events but i need some form of partials
would using raw events have a noticeable change in performace or anything?
mmno I don't think so
Need to do raw events for certain things as because they're not cached they won't get triggered by the normal event emitters.
EG: Reactions
yeah that was what i was planning on doin
Use parials
i cant smh
why ?
@grizzled raven the event that is emitted by discord will still be emitted as raw
the disabledEvents stops discord.js from processing it and emitting its own version
ie: "MESSAGE_CREATE" will still be fired by raw, but the "message" event will not
No
not performance wise
ok cool
Unless you decided to sift through each and every single event and emit it
I only need it for a couple of things for example.

Anyone having this clunky message embed format when viewing it on your phone?
Im using discord.js
ok so in js, you can do this, ```js
let obj = {}
obj["127342015"] = 42 // { "127342015": 42 }
what is the mongo equivalent?
Is it possible to add a "currently playing" embed? Like to get what the person is currently playing and then type it in as an embed?
With the new Discord privacy update coming out you better hope apply to get verified or you wont get that info anymore.
@grizzled raven it'd be something like:
<MongoDatabase>.collection(yourCollectionName).insertOne({"12342015":42}) // {_id:xxxxxxxxxxxxx, "12342015":42}
I believe
i forgot to mention
i have that object in another object
its for lb stuff
im just seeing if i should try to use mongo or just use rethink, as i was already going for rethink
mongo collections basically work as js objects
oh ok
well i'll look into it more when i try it myself
just wanted to see if i could get an example as that was the main thing i was wondering how i was gonna do
How can I create a new channel category with discord.js?
just as normal, but instead of "channel" use "category", I think
How to make bot leave voice channel if no one on voice channel for more than 5 minutes using voicestateupdate?
library: discord.js
on the voice state update, if no members are in the channel, set a timeout (setTimeout) for 5 minutes. If you get a voicestateupdate and that person joined the channel, cancel the timeout (clearTimeout)
Just created a category via bot, which string should I use to insert the id of the category just created in a variable?
await the creation then use <Category>.id like a channel
@amber fractal I don't understand. You could send me a little example of the code
let category = await (category creation code) then use category.id
@amber fractal I have got an error: Cannote use keyword await outside an async function
yeah the function needs to be async
how can i make a command in my bot
case 'topgg':
message.channel.send("Coming soon");
break;```
Have you not made a command before?
That’s js
oh
Is he actually saying he doesn't know how to make the bot say that when he says topgg?
If it's that... Then if that's the case... Then the code he showed is correct isn't it?
@edgy heron what kind of command are you trying to make?
@edgy heron oh like a command that shows bot info about the mentioned bot?
yah
not mentioned bot
only for our bot
i need to understand the api
but i dont know, i need an example
then i can do them rest
Pretty sure there are examples in the doc
really?
Yes
i need. cant find
But idk how to fetch info from the top.gg api tbh lmao
I'm wondering that question of yours too @edgy heron
Is there a way to see who added a role to a user?
You have a method called getBot(id)
That would return the bot’s id ¯_(ツ)_/
I have an extremely weird error. My bot has this line of code:
if(msg.includes("shut up meg"/*msg is message.content.toLowerCase()*/) {
message.channel.send("Yeah, Shut Up Meg!");
}
Whenever the message is typed in chat however, the message is sent multiple times and I get this error in the console:
I really don't know what to do
If you can read the error, it says missing permission. That means your bot can’t send the message
It definatly sent it
multiple times
it has admin
I had to kill it to stop general from getting flooded
are you making sure the bot doesn't accept bot's text? aka creating an infinite loop?
Yeah,
Is your bot responding to itself?
I don't think
can you show us how you did that part?
if (message.author.bot && message.author.id != "535499942970785793") {
if (message.content.startsWith(prefix)) {
message.channel.send("Shut up Meg")
}
return;
}
It only accepts one other bot and that is to censor it because it has a bad mouth
there is your problem
you check if its a bot, then - if it is - you send your response, then return. this response triggers another message event, where again. it checks if its a bot - yes it is, responds with the message etc.
yeah, that would suggest there is another problem too
Yeah, that is what is really tripping me up
lets see if we can figure out the infinite loop and the the other one
in your case you would want something like
if(message.author.bot && message.author.id != "535499942970785793") return;
// your commands etc
Interesting
The world of programming is odd to say the least
seems like you found a discord js bug thing
indeed weird, as the error did not have anything to do with what we just fixed as far as i can see 😄 but glad it's working now
thats an api thing
the client tried to make the request but the api denied
if you client disconnects, should you try to login again?
or just terminate the process
If it disconnects discord will try to resume the session
i mean the disconnect event
Emitted when the client's WebSocket disconnects and will no longer attempt to reconnect.
imo you should restart when that happens
My code wont work
@bot.command(pass_conetext=True)
async def test(ctx):
await message.send(embed)
{title: 'test'
color: 0xcolor
description: 'test'}```
what wont work
the code
im sorry what
how do i fix it?
also when u have a problem say what specifically doesnt work instead of just "my code no work"!!!!
read the docs
thats not how you make an embed
oh
maybe learn more python
embed is an object you pass into the function
sounds about right
what version of discord.py is that
Is there a way to see who added a role to a user ?
1.3.3
events
Or just listen to the event
if(command === "reseteconomy") {
await db.delete("coins", message.guild.id)
}```
Why won't this work?
I'm trying to reset all coins
quick
...
i dont think thats how it works
Well laughing about it isn't gonna help
I tried deleting the whole database of the server
Probably doesn't work like that
I tried deleting the whole database of the server
...
I'm hosting my bot on a vps but I want to be able to send data to my website (which is hosted on glitch [unfortunately]). I'm sure I'm not the only person who wants to do this as many bots put some stats on their websites. If anyone could suggest some ideas of how to achieve this (bonus: send me a useful tutorial/demo) I'd be very grateful. Please ping me with any responses. Thanks!
then do coins.delete(message.guild.id)
@true ravine you could maybe make a request to the website, like you.glitch.me/stats
then on the glitch project, listen with "/stats"
idk how to put it in words but
and itay what version of quickdb
make them communicate via HTTP
Listen for endpoints in the server, make requests to endpoints from the bot
yep that is what i was trying to say

my brain lags sometimes
unrelated question, is glitch debian or ubuntu
if(command === "reseteconomy") {
await db.delete("coins", message.guild.id)
}```
@earnest phoenix
How do you call these box where the bot can display an output?
i dont know what im doing wrong here, the message will not send
async def test(ctx):
await message.send("test")```
it worked last time
ah ok
Also pass_context is redundant
Tryna make a mention prefix in discord.js and nothing I try works
i tried and it still does not work
How do you call these box where the bot can display an output?
@tough relic do you mean Embed?
Yep someone helped me in dms!!
cough
Tryna make a mention prefix in discord.js and nothing I try works
Tried a lot of stuff and I am getting stressed about it
man why is everything
my bot still doesent work
@grizzled raven @cinder patio Thank you for your help, I will look into that 👍
@golden condor do you need help on that, or did you figure it out already? Just check if the content starts with the mention (there will be an ! if the bot has a nickname)
Send errors and code if you say your bot doesn't work
@sudden geyser I have tried
can you show your code
the program u said costs money and i dont have enough money
heres my code so far
import asyncio
from discord.ext import commands
bot = commands.Bot(command_prefix = '<')
@bot.event
async def on_ready():
print("The bot is ready!!!")
bot=commands.Bot(...)
bot.remove_command("help")
@bot.command(pass_context=True)
async def test(ctx):
await ctx.send_message("test")```
Dont start by making a discord bot
they are not beginner friendly
oh
and like there are hundreds of good places to start learning python...
https://pythondiscord.com/pages/resources/ @ripe lantern
We're a large, friendly community focused around the Python programming language. Our community is open to those who wish to learn the language, as well as those looking to help others.
i mean no
😳
cuz im not gonna charge people to learn a language
not easy money
There's good free tutorials
im not trying to earn money
what

ignore lukas

https://pythondiscord.com/pages/resources/
^^ One of the best pages to get tutorials and learn
Ignore the guys above me

Except cf
Ok, i stop shitposting here sry.
can we stop with the off-topic here please...
Say no to python, js is dashing ;)
trying to help someone and just gets carried off with shitposting 
📋
@velvet zenith need help with what?
well
@velvet zenith what
you want a free python tutorial?
the program they said to put the code in




