Skip to content
New issue

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

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

Already on GitHub? # to your account

fix: false positives for regex #111

Merged
merged 2 commits into from
Dec 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/barry/src/modules/leveling/events/messageCreate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type GuildMessageCreateDispatchData = PickRequired<GatewayMessageCreateDispatchD
/**
* A regular expression that matches messages that contain a "thank you".
*/
const THANKS_REGEX = /(?:|\s)(?:thank(?:s| you)|ty|thn?x|cheers)(?:\s|)/i;
const THANKS_REGEX = /(\s|^)(thanks?|ty|thn?x|cheers)(\p{P}|\s|$)/iu;

/**
* Tracks user activity and assigns experience and levels based on their participation in the guild.
Expand Down