Error with Flag Guilds and more.
This is my code: const { Client, Intents, MessageEmbed } = require('discord.js');
const client = new Client({
intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES]
});
const prefix = '!';
// ... (rest of your code)
client.on('ready', () => {
console.log(
Logged in as ${client.user.tag}!
);
});
client.on('messageCreate', (message) => {
if (message.author.bot || !message.content.startsWith(prefix)) {
return; // Ignore messages from bots and messages without the prefix
}
const args = message.content.slice(prefix.length).trim().split(/ +/);
const command = args.shift().toLowerCase();
if (command === 'crewid') {
const embed = new MessageEmbed()
.setColor('#000000')
.setTitle('Eternal ID')
.setDescription('The in-game crew ID for ETERNAL is 33111778.')
message.channel.send({ embeds: [embed] });
}
});
// Replace 'YOUR_BOT_TOKEN' with your actual bot token
client.login('mytoken');
const express = require('express');
const app = express();
app.get('/', (req, res) => {
res.send('Bot is online.');
});
const listener = app.listen(process.env.PORT, () => {
console.log('Your app is listening on port ' + listener.address().port);
});
And i get this error..17 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!
- ✅
Marked as resolved by OPnot a flag guilds error actually
thats my bad
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
i have v13 installed
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
dont midn the fact im on mobile atm
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
as in these?
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
not too sure how to access it
i dont use replit much
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
appreciate it!