Updated command logger

This commit is contained in:
2024-01-24 10:40:43 +01:00
parent d83ff3892e
commit 9a022ec002

View File

@@ -9,19 +9,29 @@ export = {
execute(interaction: ChatInputCommandInteraction | ButtonInteraction) {
if (interaction.isCommand()) {
let subcommand: string | null
try {
subcommand = interaction.options.getSubcommand()
} catch (e) {
subcommand = null
}
if (subcommand) {
console.log(
color(
interaction.user.username + " ran " +
interaction.user.username + "#" +
interaction.user.discriminator + " ran " +
interaction.commandName + " " +
interaction.options.getSubcommand(),
subcommand,
"pink"
)
)
} catch {
} else {
console.log(
color(
interaction.user.username + " ran " +
interaction.user.username + "#" +
interaction.user.discriminator + " ran " +
interaction.commandName,
"pink"
)