yourWaifu / sleepy-discord

C++ library for the Discord chat client. Please use Rust for new bots

Home Page:https://yourWaifu.github.io/sleepy-discord/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error 429 5005

thelifeworm opened this issue · comments

When the bot writes a lot at a time in the chat.
Happens

Error 5005: {
  "global": false,
  "message": "You are being rate limited.",
  "retry_after": 2.506
}

and it crashes.
std::terminate
image

How not to get a crash?

After #define ASIO_NO_EXCEPTIONS i get exception from sleepydiscord.
image
Is there any way to replace the exception?
for example to return an error code or something similar?

The docs already has multiple ways to avoid a crash from there kinds of errors. https://yourwaifu.dev/sleepy-discord/docs/requests
2nd, you really should slow down if you're getting rate limited. Last, defining ASIO_NO_EXCEPTIONS here isn't going to help you. LoL 🤣

Oh thank you. I now use .error()