GatewayIntentBits is not defined

idk why this is happening
11 Replies
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
Soap
Soap17mo 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
CanineData17mo ago
You need to import GatewayIntentBits from djs
Soap
Soap17mo 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 docs17mo ago
guide Creating Your Bot: Creating slash commands read more
CanineData
CanineData17mo ago
Don’t use prefix commands
Soap
Soap17mo ago
i want prefix commands tho is it possible to make the bot to respond to every message that gets sent?
MrMythical
MrMythical17mo ago
what why
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
MrMythical
MrMythical17mo ago
Do not spoonfeed. That code will api spam anyway
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View