Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a space before "tree" in the "christmas" tree holiday reaction #1404

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

shenanigansd
Copy link
Member

@shenanigansd shenanigansd commented Dec 2, 2023

Relevant Issues

This is one possible solution to #1403. I'll leave the floor open for discussion over other options.
Looks like this is the solution that fits!
Closes #1403

Description

christmas|tree -> christmas| tree to make sure that we only react to trees of the non-linked variety.

regex101 screenshots

image
image

Did you:

@shenanigansd shenanigansd changed the title Replace or with space in christmas tree holiday reaction Add a space before "tree" in the "christmas" tree holiday reaction Dec 2, 2023
@shenanigansd
Copy link
Member Author

Per discussion on Discord, it looks like we're okay still reacting to most trees, just not when they're in a link.
I suppose this is a good compromise. We really shouldn't discriminate, lest we become grinches ourselves. I'd like to go ahead and close the comment floor and open up the review floor.

bot/exts/holidays/holidayreact.py Outdated Show resolved Hide resolved
@VirdanTheBurden
Copy link
Member

Are we certain we don't mind most trees? A lot of trees can be stated that have no relation to the season itself. "Grinch's tree", sure, but then what about "skeleton tree"? That will still react with a tree; the regex matches, but that's for halloween.

If we're going to activate it for Christmas, I'd rather you match for christmas/xmas then lookahead for tree.

@wookie184 wookie184 added the status: waiting for author Waiting for author to address a review or respond to a comment label Jan 28, 2024
@shenanigansd
Copy link
Member Author

Updated to only react specifically to trees of the Christmas variety.
Screenshot:
image

@Xithrius Xithrius added area: backend Related to internal functionality and utilities status: needs review Author is waiting for someone to review and approve type: enhancement Changes or improvements to existing features category: holidays Related to holidays (Christmas, Halloween, Valentine's) and removed status: waiting for author Waiting for author to address a review or respond to a comment labels Jan 30, 2024
@@ -61,7 +61,7 @@ class Holiday(NamedTuple):
}
)
Christmas = Holiday([Month.DECEMBER], {
"christmas tree": Trigger(r"\b((christ|x)mas|tree)\b", ["\U0001F384"]),
"christmas tree": Trigger(r"\b(christ|x)mas\s?(tree(s)?)?\b", ["\U0001F384"]),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the parens around the s for pluralizing "tree" are unnecessary, but it might be slightly more readable with them

Copy link
Contributor

@wookie184 wookie184 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think making the trees group optional makes this match on just "christmas".

@thurisatic
Copy link
Contributor

is that a problem? a christmas tree seems to a good reaction for christmas, and it's the only one present

@thatbirdguythatuknownot
Copy link
Contributor

I think making the trees group optional makes this match on just "christmas".

That's also the current behavior of the regex.

@wookie184
Copy link
Contributor

In that case there's no point mentioning tree in the regex, it can just have the christmas bit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: backend Related to internal functionality and utilities category: holidays Related to holidays (Christmas, Halloween, Valentine's) status: needs review Author is waiting for someone to review and approve type: enhancement Changes or improvements to existing features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Christmas tree" holiday reaction reacts to just "tree"
8 participants