From ac420faa74d5153cd32556c6f5cd8982bbc5b6c6 Mon Sep 17 00:00:00 2001 From: toast-ts <96593068+toast-ts@users.noreply.github.com> Date: Fri, 5 Jan 2024 12:59:56 +1100 Subject: [PATCH] Add "see you later" to evening trigger --- src/modules/ResponseModule.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/modules/ResponseModule.ts b/src/modules/ResponseModule.ts index 9df1e96..9df2239 100644 --- a/src/modules/ResponseModule.ts +++ b/src/modules/ResponseModule.ts @@ -27,6 +27,8 @@ export default class Response { } protected static async respond(message:Discord.Message, responseKeyword:string) { if (message.type === Discord.MessageType.Reply) return; + // Special case for "see you later" + if (responseKeyword === 'evening' && /^see you later\b/i.test(message.content)) return message.reply(`${this.outgoingArrays(message)[responseKeyword][Math.floor(Math.random()*this.outgoingArrays(message)[responseKeyword].length)]}`).catch(()=>null); if (new RegExp(`^(${this.incomingArrays[responseKeyword].prefix.join('|')})?\\s?${responseKeyword} (${this.incomingArrays[responseKeyword].suffix.join('|')})\\b`, 'i').test(message.content)) return message.reply(`${this.outgoingArrays(message)[responseKeyword][Math.floor(Math.random()*this.outgoingArrays(message)[responseKeyword].length)]}`).catch(()=>null) } protected static outgoingArrays(message:Discord.Message) {