Valid intents must be provided?

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)

1 Like

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.

2 Likes

No I am not. Good guess though

1 Like

yeah I was trying to do the “called it” but it didn’t even work because you posted first :sob:

1 Like

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 :eyes:

1 Like

That looks right. I remember needing to copy past something like that a while ago

1 Like

thank you.

where can I find that information??

1 Like

You can find it in @bigminiboss’s post

2 Likes

You said welcome. Lets goo! :smiley:

1 Like

Thank you, for the help!

Thank you for the help!

you are welcome! :smiley: :slight_smile:

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)