GatewayIntentBits is not defined

idk why this is happening
15 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Soap
SoapOP2y 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
CanineData2y ago
You need to import GatewayIntentBits from djs
Soap
SoapOP2y 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 docs2y ago
guide Creating Your Bot: Creating slash commands read more
CanineData
CanineData2y ago
Don’t use prefix commands
Soap
SoapOP2y ago
i want prefix commands tho is it possible to make the bot to respond to every message that gets sent?
MrMythical
MrMythical2y ago
what why
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
MrMythical
MrMythical2y ago
Do not spoonfeed. That code will api spam anyway
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
KOPY
KOPY4mo ago
did you figure it out @Soap
Soap
SoapOP4mo ago
shut up
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
KOPY
KOPY4mo ago
sorry
Want results from more Discord servers?
Add your server