bot does not responding to any command

const { Client, Intents } = require('discord.js');
const client = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES] });

client.once('ready', () => {
console.log(`Logged in as ${client.user.tag}`);
});

client.on("messageCreate", (message) => {
if (message.content.startsWith("ping")) {
message.channel.send("pong!");
}
});

const botToken = 'MTE0NTQ5NDE5NTkyMzA2Mjg1Ng.GXEycV.Eejhj1kKzly-CVn7XL4rY53e5Q0_zavc2xzL0Q';
client.login(botToken);
const { Client, Intents } = require('discord.js');
const client = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES] });

client.once('ready', () => {
console.log(`Logged in as ${client.user.tag}`);
});

client.on("messageCreate", (message) => {
if (message.content.startsWith("ping")) {
message.channel.send("pong!");
}
});

const botToken = 'MTE0NTQ5NDE5NTkyMzA2Mjg1Ng.GXEycV.Eejhj1kKzly-CVn7XL4rY53e5Q0_zavc2xzL0Q';
client.login(botToken);
Node.js v20.5.1
4 Replies
d.js toolkit
d.js toolkit10mo ago
- 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!
чакчак
чакчак10mo ago
discord.js@13.16.0
d.js docs
d.js docs10mo ago
Tag suggestion for @чакчак: If you aren't getting content, embeds or attachments of a message, make sure you have the MessageContent intent enabled in the Developer Portal and provide it to your client:
const { Client, GatewayIntentBits } = require('discord.js');
const client = new Client({
intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent]
});
const { Client, GatewayIntentBits } = require('discord.js');
const client = new Client({
intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent]
});
Tag suggestion for @чакчак: - Visit the Discord developer application dashboard and select the corresponding application - Click on "Bot" on the left side - Click the "Reset Token" button and (if enabled) enter your 2FA code on the popup
чакчак
чакчак10mo ago
already ty