-
Notifications
You must be signed in to change notification settings - Fork 5
/
GreetingRegexList.ts
50 lines (44 loc) · 1016 Bytes
/
GreetingRegexList.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
const sharedGreetings = [
'nice work',
'nice( one)?',
'well done',
'congrats',
'good job',
'amazing',
'awesome',
'legends?',
'obrigad(o|a)',
'woo',
'yay',
'onya',
'cheers( mates?)?',
'ta',
'you beaut',
'good on ya( mates?)?',
'tha?n?x( to)?',
'ty',
'team player( award)?',
'(much(o|as) )?gracias',
'danke( schoen)?',
'grazie',
'(domo )?arigato',
'mahalo',
'Дякую',
];
const specificGreetings = [
'<@[^>]+> \\+{2}',
'<@[^>]+>\\+{2}',
'<@[^>]+> tks|thank(s| you)!{0,}',
'tks|thank(s| you)!{0,} <@[^>]+>',
];
const handlerPattern = '<@[^>]+>';
const prefixList = sharedGreetings.map((greeting) => {
return handlerPattern + ' ' + greeting + '\\b';
});
const suffixList = sharedGreetings.map((greeting) => {
return '\\b' + greeting + ' ' + handlerPattern;
});
const stringList = specificGreetings.concat(prefixList).concat(suffixList);
export const greetingRegexList: RegExp[] = stringList.map((pattern) => {
return new RegExp(pattern, 'i');
});