I'm trying to create my own discord bot to learn more code and to make features for my server. I've been following this tutorial on how to get started but when I run the nodemon --inspect index.js
, I get this message and it doesn't work as intended (see picture).
UnhandledPromiseRejectionWarning: AbortError: The user aborted a request.
It's the most basic of command and I've just copy-pasted so I don't understand what I've done wrong.
Here's the code:
const Discord = require('discord.js');
const client = new Discord.Client();
client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}!`);
});
client.on('message', msg => {
if (msg.content === 'ping') {
msg.reply('pong');
}
});
client.login('TOKEN');