GatewayIntentBits is not defined

idk why this is happening
15 Replies
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Soap
SoapOP3y ago
const { Client } = require("discord.js") const client = new Client({ intents: [ GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent, GatewayIntentBits.GuildMembers, ], }); client.config = require("./config.json") client.login(client.config.token).then(() => { console.log(client logged in as ${client.user.username}); client.user.setActivity(with ${client.guilds.cache.size} servers); }) .catch((err) => console.log(err)); just fixed
CanineData
CanineData3y ago
You need to import GatewayIntentBits from djs
Soap
SoapOP3y ago
yep do you know how to make the bot respond and make a command? this is my code: client.on('messageCreate', message => { if (message.content == 'soap'){ message.reply('hello im soap'); } } );
d.js docs
d.js docs3y ago
guide Creating Your Bot: Creating slash commands read more
CanineData
CanineData3y ago
Don’t use prefix commands
Soap
SoapOP3y ago
i want prefix commands tho is it possible to make the bot to respond to every message that gets sent?
MrMythical
MrMythical3y ago
what why
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
MrMythical
MrMythical3y ago
Do not spoonfeed. That code will api spam anyway
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Edit
Edit7mo ago
did you figure it out @Soap
Soap
SoapOP7mo ago
shut up
Unknown User
Unknown User7mo ago
Message Not Public
Sign In & Join Server To View
Edit
Edit7mo ago
sorry

Did you find this page helpful?