Skip to content

Random connection errors #8489

Closed
Closed
@virtual-designer

Description

@virtual-designer

Which package is this bug report for?

discord.js

Issue description

Random connection errors especially when using slash commands. I'm 100% sure my connection is strong enough. The error is given below:

ConnectTimeoutError: Connect Timeout Error
    at onConnectTimeout (D:\Rakin\Projects\sudobot-v2\node_modules\undici\lib\core\connect.js:131:24)
    at D:\Rakin\Projects\sudobot-v2\node_modules\undici\lib\core\connect.js:78:46
    at Immediate._onImmediate (D:\Rakin\Projects\sudobot-v2\node_modules\undici\lib\core\connect.js:117:33)
    at processImmediate (node:internal/timers:464:21) {
  code: 'UND_ERR_CONNECT_TIMEOUT'
}

Code sample

// client = discord client
// this code might not always fail - for me the error was coming randomly

client.on('interactionCreate', async (interaction) => {
   if (interaction.isChatInputCommand()) {
      // do some stuff like bulk deleting messages or warning users

     await interaction.reply({ content: 'Done' });
   }
});

Package version

v14.2.0

Node.js version

v16.13.0

Operating system

Windows 10

Priority this issue should have

Medium (should be fixed soon)

Which partials do you have configured?

Channel

Which gateway intents are you subscribing to?

Guilds, GuildMembers, GuildBans, GuildEmojisAndStickers, GuildInvites, GuildPresences, GuildMessages, GuildMessageReactions, GuildMessageTyping, DirectMessages, DirectMessageReactions, DirectMessageTyping, MessageContent

I have tested this issue on a development release

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions