phpmx / phpmxbot

A Slack bot for the PHP Mexico Community.
3 stars 7 forks source link

Update reactions handler #23

Open eruizdechavez opened 3 years ago

eruizdechavez commented 3 years ago

Positive reactions ~(👍🏻, 👏🏻, ✋🏻, 🙋🏻‍♂️, 🙋🏻‍♀️, 🙋🏻)~ ( ➕ )

If a user adds any of the positive reactions to a message with one or more point changes (++, --) the bot will repeat the action in the message as if the user adding the reaction had written the same message.

Negative reactions ~(👎🏻, 🙃)~ ( ➖ )

If a user adds any of the negative reactions to message with one or more point changes (++, --) the bot will repeat the action in the message as if the user adding the reaction had written the same message, BUT the points will be inverted (that is, all ++ become --, and -- become ++).

Inappropriate reactions (🖕🏻)

If a user adds any of the inappropriate reactions to a message, the user will be penalized with -100 points for inappropriate behavior.

Removing reactions

If a user decides to remove one of the above reactions, the bot must effectively undo the changes done when the reaction was added by the user (with the exception of the inappropriate reactions).

eruizdechavez commented 2 years ago

In the end, I decided to keep things simpler and only handle ➕ and ➖ for ++ and -- reactions. This avoids having to check if the same user is adding multiple reactions hence, multiple votes.