new detectors and reactions
This commit is contained in:
parent
73b906fd9b
commit
fe3fd9b1b6
11 changed files with 266 additions and 10 deletions
27
detectors/coubehDetector.js
Normal file
27
detectors/coubehDetector.js
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
import Detector from "./Detector.js";
|
||||
import { cleanMessageContent } from "../utils/strings.js";
|
||||
|
||||
const answers = [
|
||||
'Motif de ban ça',
|
||||
"Non mais t'es pas bien toi ?",
|
||||
'https://tenor.com/view/kaamelott-leodagan-somme-sorte-provocateur-gif-18229391',
|
||||
'https://tenor.com/fr/view/movies-titanic-quotes-its-been-years-84years-gif-14851580',
|
||||
'https://tenor.com/fr/view/au-bucher-shouting-gif-15611785',
|
||||
'https://tenor.com/fr/view/kaamelott-r%C3%A9purgateur-h%C3%A9r%C3%A9tique-au-bucher-gif-18206884'
|
||||
|
||||
];
|
||||
|
||||
export default class QuoicoubehDetector extends Detector {
|
||||
triggerName = 'quoicoubeh';
|
||||
|
||||
detect(message) {
|
||||
return /(?:^|\b)(quoi)?coubeh(?:\b|$)/i.test(cleanMessageContent(message));
|
||||
}
|
||||
|
||||
createSpecificReply(message) {
|
||||
if (this.detect(message)) {
|
||||
return Promise.resolve(answers[Math.floor(Math.random() * answers.length)]);
|
||||
}
|
||||
return Promise.resolve(null);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue