File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -67,10 +67,9 @@ function isCommand(msg: Discord.Message) {
6767 return msg . content . startsWith ( getConfig ( 'PREFIX' ) ) || KARMA_REGEX . test ( msg . content ) ;
6868}
6969
70+ const thxTimeoutRef = { ref : Date . now ( ) } ;
71+
7072client . on ( 'message' , async ( msg ) => {
71- if ( msg . content . includes ( '++' ) ) {
72- console . log ( msg . content , msg ) ;
73- }
7473 if ( msg . author . bot ) {
7574 return ;
7675 }
@@ -100,6 +99,13 @@ client.on('message', async (msg) => {
10099 }
101100 }
102101
102+ if ( / t h x | t h a n k s | d z i ę k i | d z i ę k u j ę | d z i e k i | d z i e k u j e / i. test ( msg . content ) ) {
103+ if ( Date . now ( ) > thxTimeoutRef . ref ) {
104+ thxTimeoutRef . ref = Date . now ( ) + 15 * 60 * 1000 ;
105+ return msg . reply ( 'protip: napisz `@nazwa ++`, żeby komuś podziękować!' ) ;
106+ }
107+ }
108+
103109 return ;
104110} ) ;
105111
You can’t perform that action at this time.
0 commit comments