Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces a Reactions handling system, integrating a message reactions into the rule-based architecture of Tony. Central to this update is the introduction of a reaction handler that leverages a rules system
AutoPinRule
which automatically pins messages that meet specific reaction criteria.Key Features
Refactoring for Clarity and Flexibility: Updated terminology from "commands" to "applications" and implemented type masking to enhance clarity and system flexibility.
Reaction Handler via Rules System: Implemented a reaction handler that operates through a rules-based system.
Reaction Example with
AutoPinRule
: Added an AutoPinRule as a practical example of how the new reaction system can be applied. This rule automatically pins messages that receive a specific reaction (the pin emoji 📌) a predefined number of times, demonstrating the system's potential for automated moderation and user interaction enhancement.Technical Details
The moderation rules system is now just called application rules which can handle moderations on messages or reactions. By registering reaction rules, the system can respond to reactions in a context-sensitive manner.
To integrate a new reaction rule, one simply adds a registration call such as: