- Joined
- Nov 1, 2022
- Messages
- 2
- Reaction score
- 0
Hi
I develop a discord bot with Javascript and the bot doesn't answer in the server.
He has the permission and is online. What am I doing wrong?
require('dotenv').config();
const Discord = require('discord.js');
const client = new Discord.Client({intents: ['GUILDS', 'GUILD_MESSAGES']});
client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}!`) })
// messages
client.on('message', (message) => {
if (message.content === 'test') {
message.channel.send('I work correctly!');
}
if (message.content === 'server') {
message.channel.send(`Server name: ${message.guild.name}\nTotal members: ${message.guild.memberCount}`);
}
});
client.login('MYSECRETCODE001248422...');
Thank you for your help.
I develop a discord bot with Javascript and the bot doesn't answer in the server.
He has the permission and is online. What am I doing wrong?
require('dotenv').config();
const Discord = require('discord.js');
const client = new Discord.Client({intents: ['GUILDS', 'GUILD_MESSAGES']});
client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}!`) })
// messages
client.on('message', (message) => {
if (message.content === 'test') {
message.channel.send('I work correctly!');
}
if (message.content === 'server') {
message.channel.send(`Server name: ${message.guild.name}\nTotal members: ${message.guild.memberCount}`);
}
});
client.login('MYSECRETCODE001248422...');
Thank you for your help.