ost
ost
DIAdiscord.js - Imagine a boo! 👻
Created by ost on 2/22/2024 in #djs-questions
The bot has started, but does not respond to the standard command (!ping)
I installed all the required resources, node.js, discord.js library, latest versions. The bot has enabled intents on the Discord Developers website. The bot is turned on, it is online, but does not respond to the only ping command. Code:
const { Client, IntentsBitField } = require('discord.js');
const myIntents = new IntentsBitField();
myIntents.add(IntentsBitField.Flags.GuildPresences, IntentsBitField.Flags.GuildMembers, IntentsBitField.Flags.MessageContent);
const client = new Client({ intents: myIntents });

client.on('ready', () => {
console.log(Запустился как ${client.user.tag}!);
});

client.on('message', msg => {
if (msg.content === '!ping') {
msg.reply('Pong');
}
});

client.login('token');
const { Client, IntentsBitField } = require('discord.js');
const myIntents = new IntentsBitField();
myIntents.add(IntentsBitField.Flags.GuildPresences, IntentsBitField.Flags.GuildMembers, IntentsBitField.Flags.MessageContent);
const client = new Client({ intents: myIntents });

client.on('ready', () => {
console.log(Запустился как ${client.user.tag}!);
});

client.on('message', msg => {
if (msg.content === '!ping') {
msg.reply('Pong');
}
});

client.login('token');
The token is valid. Help me please
14 replies