1

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.

Error Message

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');
Zsolt Meszaros
  • 21,961
  • 19
  • 54
  • 57
TechniLog
  • 11
  • 1
  • A request took longer than the specified `restRequestTimeout` (15 seconds by default), and was aborted to not lock up the request handler. It can be an internal server error on Discord's side, or just a slow connection. In case of the latter, the `restRequestTimeout` option in [`ClientOptions`](https://discord.js.org/#/docs/main/stable/typedef/ClientOptions) can be increased to prevent future AbortErrors. – Lioness100 Nov 28 '20 at 17:32

0 Answers0