1

This is the code I created to run the bot (I'm still very new to coding so I apologize, and the token was regenerated so don't worry):

const Discord = require('discord.js');
const { Client, Intents } = require ('discord.js');
const client = new Discord.Client({ intents: [Intents.FLAGS.GUILDS] })

client.on('ready', () => {
  console.log(`We are now online!`);
});

client.on('message', msg => {
  if (msg.content === '!help') {
    msg.reply('Help yourself.');
  }
});

client.login('j1mz8eMBhKcgY4yZEzbXG4sxuniVB0AY');

This is the warning I received when I used 'node index.js':

(node:64810) UnhandledPromiseRejectionWarning: ReferenceError: AbortController is not defined
    at RequestHandler.execute (/Users/Name/Desktop/Bots/node_modules/discord.js/src/rest/RequestHandler.js:172:15)
    at RequestHandler.execute (/Users/Name/Desktop/Bots/node_modules/discord.js/src/rest/RequestHandler.js:176:19)
    at RequestHandler.push (/Users/Name/Desktop/Bots/node_modules/discord.js/src/rest/RequestHandler.js:50:25)
    at async WebSocketManager.connect (/Users/Name/Desktop/Bots/node_modules/discord.js/src/client/websocket/WebSocketManager.js:128:9)
    at async Client.login (/Users/Name/Desktop/Bots/node_modules/discord.js/src/client/Client.js:245:7)
(Use `node --trace-warnings ...` to show where the warning was created)

I'm not sure what to do to fix this.

Zaf
  • 11
  • 1
  • 4
    Does this answer your question? [Why am I getting a ReferenceError: AbortController is not defined in Discord.js v13?](https://stackoverflow.com/questions/68693319/why-am-i-getting-a-referenceerror-abortcontroller-is-not-defined-in-discord-js) – Nick Parsons Oct 06 '21 at 00:43

0 Answers0