channel.createWebhook() returning Request Aborted
I can't seem to understand why this is happening.
I'm trying to create a channel webhooi and it thinks about it for 30s then outputs this error:
9 Replies
- 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!AbortError: The user aborted a request.
A request took longer than the specified timeout (15 seconds default), and was aborted to not lock up the request handler.
- This can be caused by an internal server error on Discord's side, or just a slow connection.
- In case of a slow connection, the timeout
option in RESTOptions can be increased to prevent future AbortErrors.@Qjuh what could be the reason it takes ages to create a webhook? This happens on both my production and staging environment? I don't think it's the code, the code is simple enough. My average latency to the Discord API is 1 second.
I've fixed this temporarily by raising the timeout to 30s, but this is too slow.
Other discord requests don't take this long on my client
Yeah, still gets created fine.
It only fails if it reaches the timeout
Not really a consistent thing. People use a /serverpost command to post images into their channel w/webhooks.
So i'd say one webhook gets created ever hour or so
So for example, if I have 50 channels being posted to currently, creating a new webhook would be slower to create?
But, I surely can't be hitting rate limits if it happens on both prod and stag
two diff tokens
two diff IPs
Stag has no serverposts
So it shouldn't be hitting the rate limit
No sorry, not in one server at a time
Spread across multiple guilds
I know the integration limit is 50, which I dont like lol
I thought there was no rate limits on sending to webhooks?
I had like 500 serverposts setup across different servers and I was using messages instead of webhooks. I was told that webhooks have higher rate limits than sending message content.
500 would cause me to hit the rate limits. So I had to switch to webhooks.
Sending one still uses a webhook request tho right, doesn't that count towards the overall rate limit?
I'll test this btw
hmm okay
let me check this rate limit event and i'll get back to you
thanks for helping so far
Nah
A serverpost is posting images to a server channel every few seconds. Min 10, Max 60 seconds.
it creates a webhook upon starting it. Then if it fails three times, it deletes the webhook and stops. Or if the user stops it, it will delete the webhook as well.
How come?
Upon the user using the command
/serverpost start
/serverpost stop
Webhooks do not get created more than the rate limit allows. That's for definite.
Console logs shows users use this command (on average) once or twice per hour.
We log when webhooks are created in console
Also w#e don't log usage of specific commands, but overall interactions we do.
Yeah
okay
about to push to prod
@Qjuh this event only emits when we hit a rate limit, is this correct?
@Qjuh nothing at all.
I use the command, it thinks about it for about 20s, then it works
but it shouldn't be taking 20s
The delay only occurs when it starts to create the webhook
I console.log numbers up until this point and they output to console fine and fast.
So it's defo the creation of the webhook that's the problem
yeah
two filesThis is the main command file.
Pastebin
case 'start' : { await deferReply().catch(console.er...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Then
Here is the function
beginServerposting
Pastebin
async function beginServerposting(interaction, type, category, seco...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
If it takes longer than the REST timeout, it will show the "There was a problem" embed.
nope lol
yeah we haven't changed the icon lol
hmm
actually no
we don't check that
we should
The servers in question have no more than like, 10 integrations lmao
People reached out about the issue, I can see it physically in their server
In the guild and channel integration settings
I just seen in the guild integrations (not channel) and they amounted to 10 or so
a very weird issue imo
Can't seem to get to the bottom of it.
lmaoo i didn't even know they existed
I thought integrations as a whole
Like, bots and webhooks combined
Did you have the answer to this? I no longer need it but I’m curious as to what the answer is lol