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!!!!
Spam a server with emotes
Throw an exception
Nothing, bot is stuck
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.