#how do i give my bot all intents
77 messages · Page 1 of 1 (latest)
Import it from discord.js
That’s not what you use though…
what do you use
you use GatewayIntentBits but import IntentsBitField
oho kay
ill test it
and fix that
const Discord = require('discord.js')
const { Client, GatewayIntentBits } = require('discord.js');
const fs = require('fs');
const config = require('./config.json')
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent,
GatewayIntentBits.GuildMembers,
],
});
client.on('message', (message) => {
if (message.content==='hi'){
message.channel.send('hey')
}
console.log(message.content)
})```
this is my code
the command doesnt work something abt how i set it up but new djs is so confusing
what am i doing wrong
Tag suggestion for @prisma tusk:
The message and interaction events were renamed to messageCreate and interactionCreate respectively, to bring the library in line with Discord's naming conventions.
- client.on('message', message => { ... });
+ client.on('messageCreate', message => { ... });
- client.on('interaction', interaction => { ... });
+ client.on('interactionCreate', interaction => { ... });
stop upgrading version without reading breaking changes
works ty
choosing what intents u need greatly increases peformance
Oh
also what is the intent for
message content in dms
why is it different
alr got it
if (message.channel.type =='dm'){
message.channel.send('hey')
}```
this isnt working
@prisma tusk ^
What version is the latest
14.6.0
if u look at the updating guide it covers the breaking changes
Okay
isDM()
got it
.isDMBased() man
oh
+channel.type === ChannelType.DM
if (message.channel.type===ChannelType.DM){
console.log('dmed!')
}```
not working 😦
same with isDMBasd() i tried both
Tag suggestion for @prisma tusk:
To receive direct message events on "messageCreate" with your bot, you will need:
• The DirectMessages gateway intent
• The Channel partial setting
missing partial
yup it worked tho
without array
ok tahts it close this
wait how do i
set status tho
for the bot
its not in the breaking changes
or is it the same
i dont need intent for that right
nope
not setactivity
Documentation suggestion for @prisma tusk:
ClientUser#setPresence()
Sets the full presence of the client user.
You can't

alright
client.user.setPresence('hey')
this isnt working btw
no errorr but it just doesn't change the presence
probably becuase it expects an object