im trying to learn how to make discord bot
i was running through this practice one when it wouldnt even let me do that. what am i doing wrong?? (besides the TOKEN part)
Hey, @SierraNolan welcome to the forums!
When you make the client in discord.js v14 (and later maybe) you need to add intents when you declare the client. How I do not.
No I am not. Good guess though
yeah I was trying to do the “called it” but it didn’t even work because you posted first
Yes there, you need to include intents
try something like the included example in the docs:
const { Client, GatewayIntentBits } = require('discord.js');
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent,
GatewayIntentBits.GuildMembers,
],
});
I think this is it @not-ethan
That looks right. I remember needing to copy past something like that a while ago
thank you.
where can I find that information??
You said welcome. Lets goo!
Thank you, for the help!
Thank you for the help!
you are welcome!
you also need to enable the message content intent in the ‘Bot’ section of your app in the discord developer portal.
Or, move to slash commands because those are more integrated and will be your only choice after your bot grows to need verification (make sure you stick with using an environment variable and not config.json
)