mirror of
https://github.com/toast-ts/Daggerbot-TS.git
synced 2024-11-17 16:30:58 -05:00
Add subcommands to log.
This commit is contained in:
parent
a62a567887
commit
62ecb715af
@ -4,8 +4,14 @@ 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() || !interaction.command) return;
|
||||||
if (interaction.isCommand()){
|
if (interaction.isCommand()){
|
||||||
|
let Sub:string
|
||||||
|
try{
|
||||||
|
Sub = ` ${interaction.options.getSubcommand()}`
|
||||||
|
}catch(e){
|
||||||
|
Sub = ''
|
||||||
|
}
|
||||||
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} in #${interaction.channel.name}`);
|
console.log(`[${client.moment().format('DD/MM/YY HH:mm:ss')}] ${interaction.user.tag} used /${interaction.commandName}${Sub} in #${interaction.channel.name}`);
|
||||||
if (!client.config.botSwitches.commands && !client.config.eval.whitelist.includes(interaction.user.id)) return interaction.reply({content: 'Bot is currently being run in development mode.', ephemeral: true});
|
if (!client.config.botSwitches.commands && !client.config.eval.whitelist.includes(interaction.user.id)) return interaction.reply({content: 'Bot is currently being run in development mode.', ephemeral: true});
|
||||||
if (commandFile){
|
if (commandFile){
|
||||||
try{
|
try{
|
||||||
|
Loading…
Reference in New Issue
Block a user