Issue with emoji reactions to menus in 3.5-dev #5906

Closed
opened 2022-11-16 04:39:04 +01:00 by RheingoldRiver · 2 comments
RheingoldRiver commented 2022-11-16 04:39:04 +01:00 (Migrated from github.com)

What Red version are you using?

3.5-dev starting with commit f025283

What were you trying to do?

Add emojis to a menu, like this, in a specified order, with more emojis than the rate-limit

image

What did you expect to happen?

  1. Always have the emojis print in the same order every time (we ensure that they're sent in the same order every time by our code)
  2. Handle the rate-limit errors gracefully & retry as needed

What actually happened?

Through commit d7d6ab4, this was handled fine. Starting with commit f025283, however:

  1. The emojis printed in a random order
  2. Upon hitting the ratelimit, an error was printed to the user, and no retry happened

image
image
image

How can we reproduce this error?

  1. Make a command that creates an embed and adds at least 6 emoji reactions, in the same order to it, it doesn't actually need to be a functioning menu. But here are our cogs if you want to install them. You would need dbcog and padinfo, and it should work with just that, the command is [p]id.
  2. Run the command with commit f025283 or later.

Anything else?

We updated our bot a week ago, but the issue started today, so I'm not sure what's up with that. However, rolling back the Red version fixed the issue so there's definitely something going wrong that started with that commit. And it wasn't an ephemeral thing for just a few minutes either, it was broken for about 5 hours before we thought to try a rollback.

### What Red version are you using? 3.5-dev starting with commit [f025283](https://github.com/Cog-Creators/Red-DiscordBot/commit/f02528378f0d71a7bb2de72348eae4e2718a4d38) ### What were you trying to do? Add emojis to a menu, like this, in a specified order, with more emojis than the rate-limit ![image](https://user-images.githubusercontent.com/18037011/202076836-0b331d50-e99e-469d-b264-d5ca0b484d81.png) ### What did you expect to happen? 1. Always have the emojis print in the same order every time (we ensure that they're sent in the same order every time by our code) 2. Handle the rate-limit errors gracefully & retry as needed ### What actually happened? Through commit [d7d6ab4](https://github.com/Cog-Creators/Red-DiscordBot/commit/d7d6ab46f45e7057a21df4f7f908fe6e5cf48523), this was handled fine. Starting with commit [f025283](https://github.com/Cog-Creators/Red-DiscordBot/commit/f02528378f0d71a7bb2de72348eae4e2718a4d38), however: 1. The emojis printed in a random order 2. Upon hitting the ratelimit, an error was printed to the user, and no retry happened ![image](https://user-images.githubusercontent.com/18037011/202077178-059fc817-c7c8-41e8-bc4d-d5786313d5d7.png) ![image](https://user-images.githubusercontent.com/18037011/202077239-cc0611c1-1782-4039-b63b-63d085e4e819.png) ![image](https://user-images.githubusercontent.com/18037011/202077275-3d390753-524c-4731-b143-656ee54e9ced.png) ### How can we reproduce this error? 1. Make a command that creates an embed and adds at least 6 emoji reactions, in the same order to it, it doesn't actually need to be a functioning menu. But [here are our cogs](https://github.com/TsubakiBotPad/pad-cogs) if you want to install them. You would need `dbcog` and `padinfo`, and it should work with just that, the command is `[p]id`. 2. Run the command with commit f025283 or later. ### Anything else? We updated our bot a week ago, but the issue started today, so I'm not sure what's up with that. However, rolling back the Red version fixed the issue so there's definitely something going wrong that started with that commit. And it wasn't an ephemeral thing for just a few minutes either, it was broken for about 5 hours before we thought to try a rollback.
Flame442 commented 2022-11-16 04:54:46 +01:00 (Migrated from github.com)

Seems like a duplicate of #5905, just with a different endpoint. Closing this in favor of that issue.

Seems like a duplicate of #5905, just with a different endpoint. Closing this in favor of that issue.
RheingoldRiver commented 2022-11-16 05:28:29 +01:00 (Migrated from github.com)
Exception in command 'id'
Traceback (most recent call last):
  File "/home/bot/tsubaki/prod/lib/python3.8/site-packages/discord/ext/commands/core.py", line 190, in wrapped
    ret = await coro(*args, **kwargs)
  File "/home/bot/.local/share/Red-DiscordBot/data/tsubaki_prod/cogs/CogManager/cogs/padinfo/padinfo.py", line 219, in _id
    await self._do_id(ctx, query)
  File "/home/bot/.local/share/Red-DiscordBot/data/tsubaki_prod/cogs/CogManager/cogs/padinfo/padinfo.py", line 275, in _do_id
    await menu.create(ctx, state)
  File "/home/bot/tsubaki/prod/lib/python3.8/site-packages/discordmenu/embed/menu.py", line 38, in create
    return await send_embed(ctx, embed_wrapper, message=message)
  File "/home/bot/tsubaki/prod/lib/python3.8/site-packages/discordmenu/discord_client.py", line 54, in send_embed
    await asyncio.gather(*add)
  File "/home/bot/tsubaki/prod/lib/python3.8/site-packages/discord/message.py", line 1061, in add_reaction
    await self._state.http.add_reaction(self.channel.id, self.id, emoji)
  File "/home/bot/tsubaki/prod/lib/python3.8/site-packages/discord/http.py", line 759, in request
    raise HTTPException(response, data)
discord.errors.HTTPException: 429 Too Many Requests (error code: 0): 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 1347, in invoke
    await ctx.command.invoke(ctx)
  File "/home/bot/tsubaki/prod/lib/python3.8/site-packages/discord/ext/commands/core.py", line 986, 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 199, in wrapped
    raise CommandInvokeError(exc) from exc

discord.ext.commands.errors.CommandInvokeError: Command raised an exception: HTTPException: 429 Too Many Requests (error code: 0): You are being rate limited.
``` Exception in command 'id' Traceback (most recent call last): File "/home/bot/tsubaki/prod/lib/python3.8/site-packages/discord/ext/commands/core.py", line 190, in wrapped ret = await coro(*args, **kwargs) File "/home/bot/.local/share/Red-DiscordBot/data/tsubaki_prod/cogs/CogManager/cogs/padinfo/padinfo.py", line 219, in _id await self._do_id(ctx, query) File "/home/bot/.local/share/Red-DiscordBot/data/tsubaki_prod/cogs/CogManager/cogs/padinfo/padinfo.py", line 275, in _do_id await menu.create(ctx, state) File "/home/bot/tsubaki/prod/lib/python3.8/site-packages/discordmenu/embed/menu.py", line 38, in create return await send_embed(ctx, embed_wrapper, message=message) File "/home/bot/tsubaki/prod/lib/python3.8/site-packages/discordmenu/discord_client.py", line 54, in send_embed await asyncio.gather(*add) File "/home/bot/tsubaki/prod/lib/python3.8/site-packages/discord/message.py", line 1061, in add_reaction await self._state.http.add_reaction(self.channel.id, self.id, emoji) File "/home/bot/tsubaki/prod/lib/python3.8/site-packages/discord/http.py", line 759, in request raise HTTPException(response, data) discord.errors.HTTPException: 429 Too Many Requests (error code: 0): 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 1347, in invoke await ctx.command.invoke(ctx) File "/home/bot/tsubaki/prod/lib/python3.8/site-packages/discord/ext/commands/core.py", line 986, 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 199, in wrapped raise CommandInvokeError(exc) from exc discord.ext.commands.errors.CommandInvokeError: Command raised an exception: HTTPException: 429 Too Many Requests (error code: 0): You are being rate limited. ```
Sign in to join this conversation.
No labels
Automated PR
Blocked
Blocked By: Damage Control
Blocked By: Dependency
Blocked By: Other PR
Breaking Change
Category: CI
Category: Cogs - Admin
Category: Cogs - Alias
Category: Cogs - Audio
Category: Cogs - Bank
Category: Cogs - Cleanup
Category: Cogs - CustomCommands
Category: Cogs - Dev
Category: Cogs - Downloader
Category: Cogs - Economy
Category: Cogs - Filter
Category: Cogs - General
Category: Cogs - Image
Category: Cogs - Mod
Category: Cogs - Modlog
Category: Cogs - Mutes
Category: Cogs - Permissions
Category: Cogs - Reports
Category: Cogs - Streams
Category: Cogs - Trivia
Category: Cogs - Trivia - Lists
Category: Cogs - Warnings
Category: Core - API - App Commands Package
Category: Core - API - Audio
Category: Core - API - Bank
Category: Core - API - Commands Package
Category: Core - API - Config
Category: Core - API - Other
Category: Core - API - Utils Package
Category: Core - Bot Class
Category: Core - Bot Commands
Category: Core - Command-line Interfaces
Category: Core - Downloader
Category: Core - Help
Category: Core - i18n
Category: Core - Modlog
Category: Core - Other Internals
Category: Core - RPC/ZMQ
Category: Docker
Category: Docs - Changelogs
Category: Docs - For Developers
Category: Docs - Install Guides
Category: Docs - Other
Category: Docs - User Guides
Category: Meta
Category: RPC/ZMQ methods
Category: Vendored Packages
Changelog Entry: Added
Changelog Entry: Pending
Changelog Entry: Skipped
Closed: Duplicate
Closed: External
Closed: Invalid
Closed: User Error
Closed: Won't Fix
Complex Issue
Docs-only
Feature Branch
Good First Issue
Help Wanted
High Priority
Needs Backport To stable-docs
No Activity
No Repro
QA: Bypassed
QA: Changes Requested
QA: Passed
Release Blocker
Status: Accepted
Status: Frozen
Status: In Progress
Status: Needs Discussion
Status: Needs Info
Status: Needs Triage
Status: PRs Welcome
Type: Bug
Type: Dependency Update
Type: Deprecation
Type: Enhancement
Type: Feature
Type: Informational
Type: Merge
Type: Optimisation
Type: Question
Type: Removal
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Mrcoolgamer11/Red-DiscordBot#5906
No description provided.