diff --git a/events/CommandHandler.js b/events/CommandHandler.js index 65d24996..24661c33 100644 --- a/events/CommandHandler.js +++ b/events/CommandHandler.js @@ -55,7 +55,7 @@ class CommandHandler extends BaseEvent { }); } - client.logger.log(`User ${interaction.user.tag} used ${command.command.name} in ${interaction.guild.name} with arguments: ${interaction.options.data.length > 0 ? interaction.options.data.map(arg => { return `${arg.name}: ${arg.value}`; }).join(", ") : "no args"}`, "cmd"); + client.logger.log(`User ${interaction.user.tag} used ${command.command.name} in ${interaction.guild ? interaction.guild.name : "DM"} with arguments: ${interaction.options.data.length > 0 ? interaction.options.data.map(arg => { return `${arg.name}: ${arg.value}`; }).join(", ") : "no args"}`, "cmd"); return command.execute(client, interaction, data); }