Reputation: 1
I have been trying to make a Discord bot that responds to the user when they ask for help. Sadly I can't seem to get the bot to work. I am using Discord.JS on Node.JS. Any help would be welcome.
const Discord = require('discord.js');
const bot = new Discord.Client();
const token = '[token removed]';
const PREFIX = '!';
bot.on('ready', () => {
console.log('K08 Help Bot is online!');
})
bot.on('message', message=>{
let args = message.content.substring(PREFIX.lenght).split(" ");
switch(args[0]){
case 'help':
message.reply('HELLO');
break;
}
})
bot.login(token);
Upvotes: 0
Views: 907
Reputation:
This might be the issue:
let args = message.content.substring(PREFIX.lenght).split(" ");
- length
is mistyped as lenght
On a side note: I've submitted an edit to hide your token in this question. For security, you should never share your token; it would allow someone to take over your bot!
Upvotes: 2