add a 1 minute delay on pti globe reaction
This commit is contained in:
parent
8e80c17238
commit
b50958c9cf
1 changed files with 10 additions and 1 deletions
|
@ -1,5 +1,7 @@
|
||||||
|
|
||||||
const bot = require('bbot');
|
const bot = require('bbot');
|
||||||
|
const globe_delay = 60000; // 1 minute
|
||||||
|
var globe_said = {};
|
||||||
|
|
||||||
bot.global.text({
|
bot.global.text({
|
||||||
contains: ['facebook', 'google', 'amazon', 'apple', 'microsoft']
|
contains: ['facebook', 'google', 'amazon', 'apple', 'microsoft']
|
||||||
|
@ -9,6 +11,13 @@ bot.global.text({
|
||||||
id: 'gafam-react'
|
id: 'gafam-react'
|
||||||
});
|
});
|
||||||
|
|
||||||
bot.global.text(/pe?tit? globe/i, (b) => b.respond('![pti globe](https://crapaud-fou.org/images/chat-ptiglobe.png)'), {
|
bot.global.text(
|
||||||
|
/pe?tit? globe/i
|
||||||
|
, (b) => {
|
||||||
|
if (!globe_said[b.message.user.room] || new Date().getTime() > globe_said[b.message.user.room] + globe_delay) {
|
||||||
|
b.respond('![pti globe](https://crapaud-fou.org/images/chat-ptiglobe.png)');
|
||||||
|
globe_said[b.message.user.room] = new Date().getTime();
|
||||||
|
}
|
||||||
|
}, {
|
||||||
id: 'ptiglobe-direct'
|
id: 'ptiglobe-direct'
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue