python-discord/sir-lancebot

Expand the holiday-based comment reaction to cover more than just Halloween

thurisatic opened this issue ยท 1 comments

Description & Reasoning

While it's entertaining that Sir Lancebot reacts to comments containing certain words during Halloween (more accurately, all of October), it seems mildly unfair that this feature is specific to Halloween. Surely other events - notably Christmas - deserve such entertainment as well? This issue proposes adding more events to the reaction feature.

Proposed Implementation

Implementation involves upping the number of reactable "holidays" to 7, with some having a regex trigger resulting in one of a few randomly-chosen reactions:

  • Valentines (discord reaction :heart:โค๏ธ)
  • Easter (:rabbit:๐Ÿฐ or :rabbit2:๐Ÿ‡ ; :egg:๐Ÿฅš)
  • Earth Day (:earth_africa:๐ŸŒ :earth_americas:๐ŸŒŽ or :earth_asia:๐ŸŒ)
  • Pride Month (:rainbow_flag:๐Ÿณ๏ธโ€๐ŸŒˆ)
  • Halloween (no change)
  • Hanukkah (:menorah: ๐Ÿ•Ž)
  • Christmas (:snowman:โ›„ or :snowman2:โ˜ƒ๏ธ ; :snowflake:โ„๏ธ ; :santa:๐ŸŽ… ; :christmas_tree:๐ŸŽ„ ; :deer:๐ŸฆŒ
    Other than Christmas, these are taken from pre-existing folders in the bot/exts/holidays directory. In addition, the implementation would move holidays/halloween/spookyreact.py to an all-events holidays/holidayreact.py, preventing the existence or need of very non-DRY near-duplicates in 7 different folders (and thus 7 Cogs).

lancebot_reactions_test
Note a few things in this screenshot:

  • The reaction for "snowman" is randomly chosen, but only one occurs per message
  • flake8 is excluded in the snowflake trigger regex (but this can be changed)
  • All November (just Hanukkah) and December (Hanukkah and Christmas) reactions are featured
  • ๐ŸฆŒ on Discord is not the same as on GitHub - Discord's is a face-on view, GitHub's is in profile. rainbow_flag(๐Ÿณ๏ธโ€๐ŸŒˆ) is not in this image but also different, with Discord's having no flagpole - though this may change depending on OS and client.

Additional Details

While this does increase reaction coverage to half of the year, note that most months have few reactions and thus few triggers. Even those that do - Halloween and Christmas - are unlikely to generate sufficient reaction rates to become spammy.

Would you like to implement this yourself?

  • I'd like to implement this feature myself
  • Anyone can implement this feature

This sounds like a nice idea, some thoughts:

Some events (e.g. Hanukkah) happen at different dates on different years. Is the idea that we pick a rough range that is fixed for these e.g. the whole of december? (I think that would probably be the best option)

flake8 is excluded in the snowflake trigger regex (but this can be changed)

I'm sure this is what you meant anyway, but to confirm, we should match words exactly using \b word boundary markers in the regex (how it already works) to avoid this rather than special casing matches to avoid.

While this does increase reaction coverage to half of the year, note that most months have few reactions and thus few triggers. Even those that do - Halloween and Christmas - are unlikely to generate sufficient reaction rates to become spammy.

Agree with this, and if it becomes an issue there are a bunch of things we'd be able to do (make regexes more strict, limit reactions to certain channels, reduce event durations).

I'll mark this as approved, feel free to open a PR if you're still interested!