diff --git a/cmd/themis-server/main.go b/cmd/themis-server/main.go index 9e004fb..178d5f2 100644 --- a/cmd/themis-server/main.go +++ b/cmd/themis-server/main.go @@ -897,7 +897,23 @@ func logCommandInvocation(name string, s *discordgo.Session, i *discordgo.Intera Str("params", func() string { p := make([]string, 0, len(i.ApplicationCommandData().Options)) for _, o := range i.ApplicationCommandData().Options { - p = append(p, o.Name+"="+o.StringValue()) + sb := strings.Builder{} + sb.WriteString(o.Name) + sb.WriteRune('=') + + switch o.Type { + case discordgo.ApplicationCommandOptionSubCommand, discordgo.ApplicationCommandOptionSubCommandGroup: + panic("unreachable") + case discordgo.ApplicationCommandOptionString: + sb.WriteString(o.StringValue()) + case discordgo.ApplicationCommandOptionInteger: + sb.WriteString(fmt.Sprint(o.IntValue())) + case discordgo.ApplicationCommandOptionBoolean: + sb.WriteString(fmt.Sprint(o.BoolValue())) + default: + sb.WriteString("[unsupported type]") + } + p = append(p, sb.String()) } return strings.Join(p, ", ") }()).