Every 30 minutes I want to delete all messages inside a channel besides ones that are pinned.
My code works and all, but I get an error when it has to delete more than five messages, because of the rate limit.
My question is: Does the library block my requests being sent, when it knows they will be rate-limited? Or do my requests go through and the library just detect the error from the discord api?
Also: Is there a way to catch those errors? I tried wrapping the message.delete() in a try catch, catching all exceptions but it never went into the catch block
#rate limit
1 messages · Page 1 of 1 (latest)
Hey! Once your issue is solved, press the button below to close this thread!
- Don't individually delete them, purge them
- You get ratelimited by the discord api
- Should be possible
Welp thank you
Purging was the right call and then using a lambda
For anyone in the future looking at this:
This is what my code looks like now
btw, the lib does requests and then respects ratelimits as needed, as theyre too dynamic to hardcode or anything
ah thanks