From 2c6dcda5470c8443c40c29989ad4875f48489dca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dawid=20Wysoki=C5=84ski?= Date: Sun, 30 Oct 2022 05:20:43 +0100 Subject: [PATCH] fix: fix logged command format --- internal/discord/bot.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/internal/discord/bot.go b/internal/discord/bot.go index f201a6a..444d9a2 100644 --- a/internal/discord/bot.go +++ b/internal/discord/bot.go @@ -145,11 +145,8 @@ func (b *Bot) logCommands(_ *discordgo.Session, i *discordgo.InteractionCreate) cmdData := i.ApplicationCommandData() cmd := cmdData.Name options := cmdData.Options - for len(options) > 0 { + for len(options) > 0 && options[0].Type == discordgo.ApplicationCommandOptionSubCommand { cmd += " " + options[0].Name - if options[0].Type != discordgo.ApplicationCommandOptionSubCommand { - break - } options = options[0].Options }