Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trashcan delete reaction does not work in DMs #1450

Open
hedyhli opened this issue Feb 6, 2024 · 3 comments
Open

Trashcan delete reaction does not work in DMs #1450

hedyhli opened this issue Feb 6, 2024 · 3 comments
Labels
good first issue Good for newcomers status: approved The issue has received a core developer's approval type: bug Something isn't working up for grabs Available for anyone to work on

Comments

@hedyhli
Copy link
Member

hedyhli commented Feb 6, 2024

Steps to Reproduce

  1. Run a help command in DM
  2. Click on the trash emoji

If we have the emoji there, users would expect it to delete the help embed, however it does not do anything currently.

Known Impacted Platforms

It's probably the same, but I only tested on iOS for now.

  • Web
  • Desktop
  • Android App
  • ⭕️ iOS App

Possible Solutions

If it's not possible or infeasible to actually implement this, there shouldn't be a trashcan reaction there at all. It can be misleading.

Currently I'm using .bm del to delete those help embeds instead.

Would you like to implement a fix?

Note: For high-priority or critical bugs, fixes may be implemented by staff.

Anyone can implement the bug fix

@hedyhli hedyhli added the type: bug Something isn't working label Feb 6, 2024
@shtlrs
Copy link
Member

shtlrs commented Feb 6, 2024

To help track this down, when the MESSAGE_REACTION_ADD event is fired from the gateway, discord.py calls the parse_message_reaction_add

The reaction_add event is dispatched only when the user variable is not None in this line
user = raw.member or self._get_reaction_user(message.channel, raw.user_id)

Since this is a DMChannel, the user is fetched from the _users cache, but the user doesn't exist there for reasons that I don't know yet.

One solution to this is to use the on_raw_reaction_add listener, or to use buttons instead of emojis.
We've previously discussed the usage of buttons before and we didn't quite come to the conclusion, so maybe the best approach is to either

  1. Find out why the _users cache doesn't contain the user who initiated the reaction
  2. Use the raw reaction event if the question to the previous question isn't answered.

@ChrisLovering
Copy link
Member

The second note in the docs mentions this behaviour with the event, so option 1 doesn't seem worth persuing

@shtlrs
Copy link
Member

shtlrs commented Feb 6, 2024

I have completely missed that :/
Yeah well, i guess we have our answer

@shtlrs shtlrs added good first issue Good for newcomers status: approved The issue has received a core developer's approval up for grabs Available for anyone to work on labels Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers status: approved The issue has received a core developer's approval type: bug Something isn't working up for grabs Available for anyone to work on
Projects
None yet
Development

No branches or pull requests

3 participants