Discordbot mach nicht, was er soll?
Halli hallo, ich bin gerade dabei, einen erstmal einfachen Discordbot mit JavaScript zu programmieren und wenn ich das Skript mit node.js starte, funktioniert es auch immer, der Bot kommt online und es wird Ready ausgegeben, allerdings reagiert er nicht auf meine Nachrichten, wie er soll. Er macht einfach garnichts. Das hier ist das Skript, was jemand, was ich tun muss, damit es klappt?:
const {Client, GatewayIntentBits }= require('discord.js');
const bot = new Client(
{
intents: [
GatewayIntentBits.GuildMessages
]
}
);
const TOKEN = '<mein-Token>';
bot.on('messageCreate', function(message){
console.log("message");
if (message.author.bot){
return;
}
else if(message.content.includes("Hello")){
message.reply('Hello, how are you?');
}
});
bot.on('ready', function(){
console.log("Ready");
})
bot.login(TOKEN);