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

13 lines
609 B
TypeScript
Raw Normal View History

2023-09-12 20:53:07 -04:00
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}\`\`\``));
}
}
}