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

Fix bug with unusable slash commands

This commit is contained in:
AnxietyisReal 2023-02-10 18:48:29 -08:00
parent 77be1d99c9
commit 09e475f40b

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}`);