Skip to content

Conversation

@TyrantKingBen
Copy link
Contributor

Pull Request Type

  • Feature addition
  • Bugfix
  • Documentation update
  • Code refactor
  • Tests improvement
  • CI/CD pipeline enhancement
  • Other: [Replace with a description]

Description

Adds an event and a processor for when a message has all reactions of a specific emoji removed.

Changes

  • Added MessageReactionRemoveEmoji event.
  • Added MessageReactionRemoveEmoji processor (_on_raw_message_reaction_remove_emoji) to ReactionEvents event mixin.

Related Issues

Closes #1639.

Test Scenarios

Add some emoji reactions to a message. Right-click the message and remove all of a specific reaction under the "remove reactions" option. Right-click again and remove all reactions with the "remove all reactions" option. You should see that both events are being processed.

@listen(MessageReactionRemoveAll)
async def on_message_reaction_remove_all(event: MessageReactionRemoveAll) -> None:
    print(f"all emojis removed from message")

@listen(MessageReactionRemoveEmoji)
async def on_message_reaction_remove_emoji(event: MessageReactionRemoveEmoji) -> None:
    print(f"all {event.emoji} emojis removed from message")

Python Compatibility

  • I've ensured my code works on Python 3.10.x
  • I've ensured my code works on Python 3.11.x

Checklist

  • I've run the pre-commit code linter over all edited files
  • I've tested my changes on supported Python versions
  • I've added tests for my code, if applicable
  • I've updated / added documentation, where applicable

@eightween eightween added the enhancement New feature or request label Mar 30, 2024
@eightween eightween merged commit 5864839 into interactions-py:unstable Mar 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants