rename to fix
This commit is contained in:
parent
a3836be22d
commit
dc547a66f8
7 changed files with 30 additions and 64 deletions
30
detectors/quoicoubehDetector.js
Normal file
30
detectors/quoicoubehDetector.js
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
import Detector from "./Detector.js";
|
||||
import { cleanMessageContent } from "../utils/strings.js";
|
||||
|
||||
/*check if someone reply to a "quoi" with a "quoicoubeh" or "coubeh"
|
||||
send roasts
|
||||
*/
|
||||
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