My bot receives command requests through its interactions endpoint url.
I mostly respond to all messages by deferring and updating the message later when the data is ready, since that's a better option UX wise.
Following the docs, editing an initial messages is through:
PATCH /webhooks/<application_id>/<interaction_token>/messages/@original
This works, most of the time, but sometimes, the tokens discord sends me don't work.
As you can see in my sentry. Hundreds of messages fail due to this error.
[!NOTE]
While the token is still active in the 15 minutes window, any API requests send to it return with 404: Not found
[!NOTE]
After the 15 mins window, any API request made to it returns 401: Unauthorized
[!NOTE]
Again this is true for all API requests using the token, including deleting the message, getting the message, and sending a followup.
I tried retying the failed requests, delaying then retying, lowering the API version, but nothing worked so far.
Description
This has been an issue in my bot for months.
My bot receives command requests through its interactions endpoint url.
I mostly respond to all messages by deferring and updating the message later when the data is ready, since that's a better option UX wise.
Following the docs, editing an initial messages is through:
PATCH /webhooks/<application_id>/<interaction_token>/messages/@original
This works, most of the time, but sometimes, the tokens discord sends me don't work. As you can see in my sentry. Hundreds of messages fail due to this error.
I tried retying the failed requests, delaying then retying, lowering the API version, but nothing worked so far.
Tokens are not modified after being received.
Steps to Reproduce
Issue is unclear and hard to reproduce.
Expected Behavior
New tokens should work for 15 mins.
Current Behavior
Some fresh tokens are invalid/unknown/not found.
Screenshots/Videos
No response
Client and System Information
My bot/app is https://github.com/ker0olos/fable It sends requests directly to Discord API, I don't use a third-party library.
Production version is hosted on Deno Deploy.