Merge pull request #10 from MarkEEaton/rate-limit-notification
Rate limit notification
This commit is contained in:
commit
cc35769d83
|
@ -67,6 +67,10 @@ def checkToots(timeline, deleted_count=0):
|
|||
deleted_count += 1
|
||||
# unreblog the original toot (their toot), not the toot created by boosting (your toot)
|
||||
if not options.test:
|
||||
if mastodon.ratelimit_remaining == 0:
|
||||
print(
|
||||
"Rate limit reached. Waiting for a rate limit reset..."
|
||||
)
|
||||
mastodon.status_unreblog(toot.reblog)
|
||||
else:
|
||||
print(
|
||||
|
@ -80,6 +84,10 @@ def checkToots(timeline, deleted_count=0):
|
|||
2
|
||||
) # wait 2 secs between deletes to be a bit nicer to the server
|
||||
if not options.test:
|
||||
if mastodon.ratelimit_remaining == 0:
|
||||
print(
|
||||
"Rate limit reached. Waiting for a rate limit reset..."
|
||||
)
|
||||
mastodon.status_delete(toot)
|
||||
except MastodonError as e:
|
||||
print("🛑 ERROR deleting toot - " + str(toot.id) + " - " + e.args[3])
|
||||
|
|
Loading…
Reference in New Issue