#404 Unauthorized on Message Edit

1 messages · Page 1 of 1 (latest)

upbeat sand
#

Does anyone know why I may get a 401 error after editing a message?

I explain: I have a bot that allows having timers. I create a thread for each timer, and they update the message every minute so that the user sees the time reflected.

The problem is that sometimes (after a while), I get the 401 error, Unauthorized.
This has never happened to me in the first 15 minutes.

The code is straightforward. It decrements one minute and updates the message.

sturdy ridge
#

it sounds like you should handle the editing and decrement logic in a task loop

upbeat sand
#

It' s done through a slash command.

#

Could you explain to me how to do this through a task?

sturdy ridge
#

my recommendation would be that inside the slash command, you can save the message and timer to a dict

#

then inside the task you can iterate through all items() in the dict and do your logic

upbeat sand
#

Thanks 😄