1
0
mirror of https://github.com/toast-ts/Daggerbot-TS.git synced 2024-11-17 16:30:58 -05:00

Refactor CmdModule.ts

This commit is contained in:
AnxietyisReal 2024-01-06 20:49:12 +11:00
parent 1c3c14a159
commit b151f04c48

View File

@ -7,14 +7,13 @@ export default class CmdTrigger {
return message.content.toLowerCase().startsWith(this.prefix+trigger)
}
static registerCmds(client:TClient, message:Message, trigger:string) {
if (this.SenseTrigger(message, trigger) && client.config.whitelist.includes(message.author.id)) {
if (!this.SenseTrigger(message, trigger) ?? !client.config.whitelist.includes(message.author.id)) return;
(client.guilds.cache.get(message.guildId) as Guild).commands.set(client.registry)
.then(()=>message.reply('Deployed the slash commands successfully!'))
.catch(e=>message.reply(`Failed to deploy slash commands:\n\`\`\`${e.message}\`\`\``));
}
}
static MFPwTrigger(message:Message, trigger:string) {
if (this.SenseTrigger(message, trigger)) {
if (!this.SenseTrigger(message, trigger)) return;
let passwordText = 'The farm password is ';
const mapping = {
'1149138133514981386': 'koops',
@ -25,4 +24,3 @@ export default class CmdTrigger {
}
}
}
}