Closed TheWizardofGauze closed 1 year ago
This is the second time this is getting reported, so something is definitely up with the rate limits today. I'm able to repro this right now running [p]help
3 times in a row. Seems like Discord pushed some kind of change to DM rate limits that dpy isn't handling correctly (are the headers wrong for some reason? wouldn't put it past Discord...). Keeping this open until this is resolved, or we hear word from Danny/Discord about what's up, because I swear this didn't happen in the past.
As a work around for now, you can use [p]helpset usemenus t
to make help into a single-message menu, which should at least lower the amount of API requests it makes.
Edit: It also seems like the DM version of this issue only happens on 3.4.18, where as the reaction version of this issue only happens on 3.5.0.dev.
Minimal code to reproduce River's similar issue with reactions on dpy 2.0 only is the following:
await asyncio.gather(*[ctx.message.add_reaction(e) for e in guild.emojis[:10]])
(Assuming your guild has 10 emojis)
I got another rate limit error printed to channel just now (even after rolling back). Here's the traceback:
Exception in command 'idsearch'
Traceback (most recent call last):
File "/home/bot/tsubaki/prod/lib/python3.8/site-packages/discord/ext/commands/core.py", line 187, in wrapped
ret = await coro(*args, **kwargs)
File "/home/bot/.local/share/Red-DiscordBot/data/tsubaki_prod/cogs/CogManager/cogs/padinfo/padinfo.py", line 552, in idsearch
await self._do_idsearch(ctx, query)
File "/home/bot/.local/share/Red-DiscordBot/data/tsubaki_prod/cogs/CogManager/cogs/padinfo/padinfo.py", line 570, in _do_idsearch
await self._do_monster_list(ctx, dbcog, query, queried_props, 'ID Search Results',
File "/home/bot/.local/share/Red-DiscordBot/data/tsubaki_prod/cogs/CogManager/cogs/padinfo/padinfo.py", line 654, in _do_monster_list
await parent_menu.transition(message, ims, MonsterListEmoji.refresh, ctx.author, **data)
File "/home/bot/tsubaki/prod/lib/python3.8/site-packages/discordmenu/embed/menu.py", line 77, in transition
await remove_reaction(message, emoji_clicked, member.id)
File "/home/bot/tsubaki/prod/lib/python3.8/site-packages/discordmenu/discord_client.py", line 37, in remove_reaction
await message.remove_reaction(emoji_cache.get_raw_emoji(emoji), member)
File "/home/bot/tsubaki/prod/lib/python3.8/site-packages/discord/message.py", line 1027, in remove_reaction
await self._state.http.remove_reaction(self.channel.id, self.id, emoji, member.id)
File "/home/bot/tsubaki/prod/lib/python3.8/site-packages/discord/http.py", line 512, in request
raise HTTPException(response, data)
discord.errors.HTTPException: 429 Too Many Requests (error code: 31001): You are being rate limited.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/bot/tsubaki/prod/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 1232, in invoke
await ctx.command.invoke(ctx)
File "/home/bot/tsubaki/prod/lib/python3.8/site-packages/discord/ext/commands/core.py", line 931, in invoke
await injected(*ctx.args, **ctx.kwargs) # type: ignore
File "/home/bot/tsubaki/prod/lib/python3.8/site-packages/discord/ext/commands/core.py", line 196, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: HTTPException: 429 Too Many Requests (error code: 31001): You are being rate limited.
I forgot to follow up about this. We revisited the upgrade about a month ago, and at this point Dpy was on 2.2, and the error is totally gone. So we think there was some issue temporarily with async handling of emotes in 1 release of Dpy and at least our error no longer applies. We're now fully caught up in the Red development branch and having no issues, the repro should not be possible anymore.
Not sure if the DM issue is still happening though.
Yup, seems like the reaction issue has been fixed either in a newer version of dpy or by discord. I can't replicate the DM issue on 3.4.18 anymore either, so it seems like that was a temporary thing as well. Thanks for bumping this.
What Red version are you using?
3.4.18
Cog name
Core
Command name
help
What did you expect to happen?
All pages of the help list should be sent to DMs.
What actually happened?
A few pages are sent before the bot posts
and it abruptly stops.
How can we reproduce this error?
Anything else?
Traceback: