#rate limit

1 messages · Page 1 of 1 (latest)

slow lava
#

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

obtuse parcelBOT
#

Hey! Once your issue is solved, press the button below to close this thread!

heady kelp
#
  1. Don't individually delete them, purge them
  2. You get ratelimited by the discord api
  3. Should be possible
slow lava
#

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

ornate path
#

btw, the lib does requests and then respects ratelimits as needed, as theyre too dynamic to hardcode or anything

slow lava
#

ah thanks