Discord.py: create_custom_emoji hangs forever

Created on 2 Jun 2020  Â·  10Comments  Â·  Source: Rapptz/discord.py

Summary

Calling create_custom_emoji while being emote rate-limited, will cause it to never return. Well.... I can only guess that it maybe keeps retrying, but the emote rate limit seems to be 30min!!!!

Reproduction Steps

Spam a server with emotes

Expected Results

Throw an exception

Actual Results

Nothing, bot is stuck

Checklist

  • [ x] I have searched the open issues for duplicates.
  • [ x] I have shown the entire traceback, if possible.
  • [ x] I have removed my token from display, if visible.
invalid

All 10 comments

The lib sleeps until the rate limit is over rather than erroring, see https://github.com/Rapptz/discord.py/issues/4155#issuecomment-636269552

Awesome, guess every dev has to go through an obligatory one hour of debugging, because of this.

Consider not spamming. Rate limits are dynamic and some tend to be long.

Who said I was spamming? My users might though, and they'd probably like to know why the bot suddenly stopped working. In their defense, the ratelimit triggers very quickly too. Yes, before you say anything, I did work around the issue. It doesn't matter.

Bypassing ratelimits is against discord’s api terms of service, I would advise you not to do so.

You can use command cooldowns to block users from spamming.

A way to return without creating the emoji if it would be rate limited would be useful

You are always welcome to make your own bot without a library btw. Nobody at Discord said you had to use library wrappers.

From: Simon Beal notifications@github.com
Sent: Friday, June 5, 2020 4:35 AM
To: Rapptz/discord.py discord.py@noreply.github.com
Cc: Alex Liu alxliu@hotmail.com; Comment comment@noreply.github.com
Subject: Re: [Rapptz/discord.py] create_custom_emoji hangs forever (#4173)

A way to return without creating the emoji if it would be rate limited would be useful

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHubhttps://github.com/Rapptz/discord.py/issues/4173#issuecomment-639427097, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AHH3VSSG6GGCTJGN6QQOGX3RVDJ53ANCNFSM4NQ3Y7OQ.

The point of feature requests is to extend the library. I already have a solution to this problem myself by patching out the retrying for my own purposes, but that's completely not the point

As mentioned in the issue I linked, if you want a timeout then add one yourself using wait_for.

Was this page helpful?
0 / 5 - 0 ratings