GatewayIntentBits is not defined

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