Skip to content

Commit b669eae

Browse files
committed
Add ++ hint
1 parent 8ef758b commit b669eae

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/app.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff 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+
7072
client.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 (/thx|thanks|dzięki|dziękuję|dzieki|dziekuje/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

0 commit comments

Comments
 (0)