connection_timeout when using [Register a slash command against the Discord API] 's code

ok, so i m just getting started in doing discord, i open the discord.js, followed the instructions to npm installed the discord.js version fourteen ,and then i pressed these lovely code in my koa project , i have to use the require method instead of just import the { REST, Routes } and it came out 'connection_timeout' error and nothing else about why this is happening nor what should i do to avoid this , this code have two necessary params : setToken needs the bot token , i gave ,Route.applicationcommands needs the bot's application.id,which is a bunch of number in string type to be exact . i think i run them in correctly .so ....what's wrong? this is just a test bot , no privacy should be protected.
No description
No description
No description
No description
15 Replies
d.js toolkit
d.js toolkit15mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
Prolewin
ProlewinOP15mo ago
error is like this.
No description
Prolewin
ProlewinOP15mo ago
and the version is the latest version"^14.13.0"\
jay
jay15mo ago
slow connection shrug
Prolewin
ProlewinOP15mo ago
ok just for the record ,what should i do ? i have the vpn called the ...v2ray? or something ? redirect america probably near silicon valley? atleast that;s what the ip says the last time i parse it .. so should i use an vpn or ?
monbrey
monbrey15mo ago
no, routing through more places does not make your connection quicker Im not even sure this is djs? I dont see it in the stack trace
Prolewin
ProlewinOP15mo ago
yeah ,but ,i mean , this does comes from the ...wait a minute you think i accidently used some whatnaughts apis comes from no where instead of the rest from discord.js i required? ill check no im using that im sure of it
monbrey
monbrey15mo ago
what?
Prolewin
ProlewinOP15mo ago
yes but it does comes from the rest api discord.js provided me ..so ...
monbrey
monbrey15mo ago
I cant follow what youre saying
Prolewin
ProlewinOP15mo ago
ConnectTimeoutError: Connect Timeout Error at onConnectTimeout (D:\webstorm_projects\koa-gpt-xcx\node_modules\undici\lib\core\connect.js:182:24) at D:\webstorm_projects\koa-gpt-xcx\node_modules\undici\lib\core\connect.js:129:46 at Immediate._onImmediate (D:\webstorm_projects\koa-gpt-xcx\node_modules\undici\lib\core\connect.js:168:33) at processImmediate (node:internal/timers:466:21) { code: 'UND_ERR_CONNECT_TIMEOUT' } all the stack trace gave me
monbrey
monbrey15mo ago
yeah, no mention of discord.js there You might have an ssl issue?
Prolewin
ProlewinOP15mo ago
but the error a hundred percent came from the put request .. If other apis in the project works perfectly in or out ... how do i know its a ssl issue ? how do i find it?
wizard
wizard15mo ago
its a network-related issue, whether your connection is slow or not reachable it's still not djs related just dont use vpns as they're completely useless when dealing with these situations
Unknown User
Unknown User15mo ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server