|
|
|
@ -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, ", ")
|
|
|
|
|
}()).
|
|
|
|
|