discord / discord-api-docs

Official Discord API Documentation
https://discord.com/developers/docs/intro
Other
5.84k stars 1.23k forks source link

Invalid webhooks tokens #6851

Open ker0olos opened 1 month ago

ker0olos commented 1 month ago

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.


[!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.


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.

ckohen commented 1 month ago

Possibly related to https://github.com/discord/discord-api-docs/issues/5558