Skip to content

Commit 3d6589c

Browse files
authored
feat: multi-language "thank you" (#159)
1 parent f9345fb commit 3d6589c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/modules/rep.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ export class RepModule extends Module {
1919

2020
MAX_REP = 3;
2121

22-
THANKS_REGEX = /\b(?:thank|thanks|thx|cheers|thanx|thnks|ty|tysm|tks|tkx)\b/i;
22+
// The Chinese is outside the group on purpose, because CJK languages don't have word bounds. Therefore we only look for key characters
23+
THANKS_REGEX = /\b(?:thank|thanks|thx|cheers|thanx|thnks|ty|tysm|tks|tkx|danke|merci|gracias|grazie|xiexie)\b|/i;
2324

2425
async getOrMakeUser(user: User) {
2526
let ru = await RepUser.findOne(

0 commit comments

Comments
 (0)