#I made simple discord js bot but i get error

20 messages · Page 1 of 1 (latest)

plucky wraithBOT
#

• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.

cobalt ginkgo
#

You did not provide any intents

limpid pagodaBOT
cobalt ginkgo
#

Run npm ls discord.js

#

Its GatewayIntentBits in v14

#

Dont even know how you got the v13 code

#

Not really no

dim cloud
#

Missing intent in client constructor?

limpid pagodaBOT
dim cloud
#

Since you managed to both write v12 and then v13 code I‘d suggest you refer to the official guide instead of third-party tutorials or content

#

And does someone send a DM to your bot?

#

And is that code in the same scope you defined your client in?

#

Show your file

cobalt ginkgo
#

Missing GuildMessages intent and Channel partial

#

And probably better to enable Guilds too

dim cloud
#

Only missing Channel partial in this case

#

No need for GuildMessages to receive DMs

#

Ah, ignore me… didn’t see the first if

limpid pagodaBOT
#

To receive direct message events on "messageCreate" with your bot, you will need:
• The DirectMessages gateway intent
• The Channel partial setting

cobalt ginkgo
#

Did you enable the partial