1
0
mirror of https://github.com/toast-ts/Daggerbot-TS.git synced 2024-12-28 08:55:38 -05:00

Fix bug with unusable slash commands

This commit is contained in:
toast-ts 2023-02-10 18:48:29 -08:00
parent 1649050980
commit 7eed1d55ab

View File

@ -2,7 +2,7 @@ import Discord from 'discord.js';
import TClient from '../client'; import TClient from '../client';
export default { export default {
async run(client:TClient, interaction:Discord.ChatInputCommandInteraction){ async run(client:TClient, interaction:Discord.ChatInputCommandInteraction){
if (!interaction.inGuild() || !interaction.inCachedGuild() || !interaction.command) return; if (!interaction.inGuild() || !interaction.inCachedGuild()) return;
if (interaction.isChatInputCommand()){ if (interaction.isChatInputCommand()){
const commandFile = client.commands.get(interaction.commandName); const commandFile = client.commands.get(interaction.commandName);
console.log(`[${client.moment().format('DD/MM/YY HH:mm:ss')}] ${interaction.user.tag} used /${interaction.commandName} ${interaction.options.getSubcommand(false) ?? ''} in #${interaction.channel.name}`); console.log(`[${client.moment().format('DD/MM/YY HH:mm:ss')}] ${interaction.user.tag} used /${interaction.commandName} ${interaction.options.getSubcommand(false) ?? ''} in #${interaction.channel.name}`);