sir-lancebot icon indicating copy to clipboard operation
sir-lancebot copied to clipboard

Trashcan delete reaction does not work in DMs

Open hedyhli opened this issue 1 year ago • 3 comments

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 avatar Feb 06 '24 12:02 hedyhli

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.

shtlrs avatar Feb 06 '24 16:02 shtlrs

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

ChrisLovering avatar Feb 06 '24 17:02 ChrisLovering

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

shtlrs avatar Feb 06 '24 17:02 shtlrs