#Intents

1 messages · Page 1 of 1 (latest)

tight magnet
#

This was just for me. It would say that FLAGS is not a property of undefined (Intents) I also had issues like MessageEmbed is not a constructor. I found workarounds to these though.

jagged jetty
#

So should I define intents?

tight magnet
#

for intents I just put a number, like:

const client = new Client({
    intents: 33283
});

Then I would use this to generate the number https://ziad87.net/intents/

#

It just worked for me, because none of the imports wanted to work.

#

Hopefully this solves your problem!

proud tangle
#

1, Do not use magic numbers.
2, that website is not up to date to current intents
3, Use the Enums..

jagged jetty
#

Are you using GatewayIntentBits to represent this?

true violet
#

Yes

tight magnet
true violet
#

If you are using partials, import Partials from discord.js

tight magnet
#

Thanks for correcting me.

jagged jetty
#

GatewayIntentBits.GUILD_Messages?

true violet
#

GatewayIntentBits.GuildMessages

proud tangle
#

yes u aren't. Use GatewayIntentBits.<Flags> Flags wud be PascalCased

true violet
#

PascalCase

jagged jetty
proud tangle
jagged jetty
#
client.on("messageCreate", message => {
if (message.content == "ping") {
message.channel.send("pong")
}
})