mirror of
https://github.com/toast-ts/Daggerbot-TS.git
synced 2024-11-17 20:30:58 -05:00
13 lines
609 B
TypeScript
13 lines
609 B
TypeScript
|
import Discord from 'discord.js';
|
||
|
import TClient from '../client.js';
|
||
|
|
||
|
export default class CmdTrigger {
|
||
|
static registerCmds(client:TClient, message:Discord.Message, trigger:string) {
|
||
|
if (message.content.startsWith(trigger) && client.config.whitelist.includes(message.author.id)) {
|
||
|
(client.guilds.cache.get(message.guildId) as Discord.Guild).commands.set(client.registry)
|
||
|
.then(()=>message.reply('How did you manage to lose the commands??? Anyways, it\'s re-registered now.'))
|
||
|
.catch((e:Error)=>message.reply(`Failed to deploy slash commands:\n\`\`\`${e.message}\`\`\``));
|
||
|
}
|
||
|
}
|
||
|
}
|