deferReply not working on specific server
Hello.
We are running a small hosting service for Discord bots but one of our servers can't execute
editReply
from DIscord.js. Discord.py works just fine.
The bots just stay on "is thinking..." until that eventually times out. After around 35 minutes the console shows an API error "Invalid Webhook Token".
The weird thing is that everything else works fine and as I said, with Python bots it works as well. It's just the editReply
function on this one particular server.
Does anyone have an idea what the issue might be or how to solve this?6 Replies
• 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.This sounds very much like a rate limit
It's not a rate limit. Everything works despite this one single function. And it works in Python
Please add the following code to your code base outside of any other event listeners and provide the full log output relevant to your issue.
• Note: if you initialize your Client as
bot
or other identifiers you need to use these instead of client
• If the output is too long to post consider using a bin instead: gist | paste.gg | sourceb.in | hastebinUse this
I already did. No output
What versions would be outdated? I don't think that's the issue. I freshly created the test bot, so NPM probably downloaded LTS and all the bots that don't work on this server, work on the other ones or on the people's local machines.
Ok, but in that case it still doesn't work with up to date bots. And as I already said, the bots that can't execute
editReply
on this one server, can execute it everywhere else. Be it another server or locally on the people's pc
No, it's just a Docker container. All servers have the same Docker images.
Hmm. But then why would just one specific function not work and throw an "Invalid Webhook Token" API error, while Python works just fine doing the exact same thing? We are facing this issue since months and we have no idea what the issue could be. Both servers are running the exact same Docker images, so the bots are basically running in the exact same enviroment on both servers. Also normal webhooks work just fine on the server. So it does at least have something to do with Discord.js and since I don't know enough about the implementation of Djs itself, I thought I'd ask here so that someone maybe has an idea what could be the issue.
Both return version 14.11.0, no rate limit errors occur
It didn't really produce anything that has to do with that. Just typical heartbeats etc. But after around 30 mins I get this "Inavlid Webhook Token" error
Alright, so it now returned a 429. So it's basically the interactoin webhook route being rate limited? Does Dpy use a different route?
Here's the headers:
Thought that... It's pretty much impossible to find this bot/these bots...
So CF can also rate limit specific endpoints? Since everything else works
I get it everytime I wanna use editReply()
Why exactly?
I just wanted to ask if applying for an increased global rate limit would help, but Discord even says:"Interaction endpoints are not bound to the bot's Global Rate Limit."...
I just compared the implementations of D.py and D.js and they do it the exact same way. I think a friend just didn't test it properly when he said that it works in Py. I asked him to test it again.
Is there any potential fix for this? We can't control the behavior of the bots on this server for the most part. Is it possible to request increased rate limits bound to IP?
I'm talking about hosting servers, yeah
Well, the Docker container these bots are running on
Yes, we are running the host