Ports that discordjs is using?

For now for my bot to work i enabled all ports in egress rules, but I need to know which port(or port range) is discord using?
2 Replies
d.js toolkit
d.js toolkit2y ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
Nikola Nedeljkovic
Ok, thank you! I just tested it, and its not working. When command is issued bot just crashes journalctl logs:
Jun 30 17:38:04 dora node[1341704]: /home/ubuntu/discord-bots/nubz-dj/node_modules/undici/index.js:109
Jun 30 17:38:04 dora node[1341704]: Error.captureStackTrace(err, this)
Jun 30 17:38:04 dora node[1341704]: ^
Jun 30 17:38:04 dora node[1341704]: TypeError: fetch failed
Jun 30 17:38:04 dora node[1341704]: at fetch (/home/ubuntu/discord-bots/nubz-dj/node_modules/undici/index.js:109:13)
Jun 30 17:38:04 dora node[1341704]: at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Jun 30 17:38:04 dora node[1341704]: at async fetchRecommendedShardCount (/home/ubuntu/discord-bots/nubz-dj/node_modules/discord.js/src/util/Util.js:70:20)
Jun 30 17:38:04 dora node[1341704]: at async ShardingManager.spawn (/home/ubuntu/discord-bots/nubz-dj/node_modules/discord.js/src/sharding/ShardingManager.js:190:16) {
Jun 30 17:38:04 dora node[1341704]: cause: ConnectTimeoutError: Connect Timeout Error
Jun 30 17:38:04 dora node[1341704]: at onConnectTimeout (/home/ubuntu/discord-bots/nubz-dj/node_modules/undici/lib/core/connect.js:182:24)
Jun 30 17:38:04 dora node[1341704]: at /home/ubuntu/discord-bots/nubz-dj/node_modules/undici/lib/core/connect.js:129:46
Jun 30 17:38:04 dora node[1341704]: at Immediate._onImmediate (/home/ubuntu/discord-bots/nubz-dj/node_modules/undici/lib/core/connect.js:170:9)
Jun 30 17:38:04 dora node[1341704]: at process.processImmediate (node:internal/timers:476:21) {
Jun 30 17:38:04 dora node[1341704]: code: 'UND_ERR_CONNECT_TIMEOUT'
Jun 30 17:38:04 dora node[1341704]: }
Jun 30 17:38:04 dora node[1341704]: }
Jun 30 17:38:04 dora node[1341704]: Node.js v18.16.0
Jun 30 17:38:04 dora node[1341704]: /home/ubuntu/discord-bots/nubz-dj/node_modules/undici/index.js:109
Jun 30 17:38:04 dora node[1341704]: Error.captureStackTrace(err, this)
Jun 30 17:38:04 dora node[1341704]: ^
Jun 30 17:38:04 dora node[1341704]: TypeError: fetch failed
Jun 30 17:38:04 dora node[1341704]: at fetch (/home/ubuntu/discord-bots/nubz-dj/node_modules/undici/index.js:109:13)
Jun 30 17:38:04 dora node[1341704]: at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Jun 30 17:38:04 dora node[1341704]: at async fetchRecommendedShardCount (/home/ubuntu/discord-bots/nubz-dj/node_modules/discord.js/src/util/Util.js:70:20)
Jun 30 17:38:04 dora node[1341704]: at async ShardingManager.spawn (/home/ubuntu/discord-bots/nubz-dj/node_modules/discord.js/src/sharding/ShardingManager.js:190:16) {
Jun 30 17:38:04 dora node[1341704]: cause: ConnectTimeoutError: Connect Timeout Error
Jun 30 17:38:04 dora node[1341704]: at onConnectTimeout (/home/ubuntu/discord-bots/nubz-dj/node_modules/undici/lib/core/connect.js:182:24)
Jun 30 17:38:04 dora node[1341704]: at /home/ubuntu/discord-bots/nubz-dj/node_modules/undici/lib/core/connect.js:129:46
Jun 30 17:38:04 dora node[1341704]: at Immediate._onImmediate (/home/ubuntu/discord-bots/nubz-dj/node_modules/undici/lib/core/connect.js:170:9)
Jun 30 17:38:04 dora node[1341704]: at process.processImmediate (node:internal/timers:476:21) {
Jun 30 17:38:04 dora node[1341704]: code: 'UND_ERR_CONNECT_TIMEOUT'
Jun 30 17:38:04 dora node[1341704]: }
Jun 30 17:38:04 dora node[1341704]: }
Jun 30 17:38:04 dora node[1341704]: Node.js v18.16.0
Ok then, thank you! 👍
Want results from more Discord servers?
Add your server