I have make a simple script to test my bot. Bot started and I show "is online" on discord and log a message.
But why when I type a command, bot not sending any message?
const Discord = require("discord.js")
const client = new Discord.Client()
let token = "xxx";
client.login(token)
client.on("ready", ready => {
console.log("Bot lancé avec succès 10 !")
client.user.setActivity("IN DEVELOPPEMENT")
});
client.on("message", message => {
if (message.content === "!ping") {
console.log("Bot lancé avec succès 111111 !")
message.channel.send("Pong.")
}
})
Is there a reason why this is not working? Am I missing something?