diff --git a/internal/discord/commands.go b/internal/discord/commands.go index 7a13ed0..4499a85 100644 --- a/internal/discord/commands.go +++ b/internal/discord/commands.go @@ -12,7 +12,7 @@ import ( var ( // map of guildID to registeredCommands - registeredCommands map[string][]*discordgo.ApplicationCommand + registeredCommands = make(map[string][]*discordgo.ApplicationCommand) // all commands commandList = []*discordgo.ApplicationCommand{ @@ -28,6 +28,7 @@ var ( Description: "anonymously post a confession in configured channel", Options: []*discordgo.ApplicationCommandOption{ &discordgo.ApplicationCommandOption{ + Type: discordgo.ApplicationCommandOptionString, Name: "confession", Description: "A confession to be posted anonymously", Required: true, @@ -79,11 +80,11 @@ func registerCommands(s *discordgo.Session) { if err != nil { logging.Error( - "Failed to register commands for guild %s: %s", - guild.ID, err.Error(), + "Failed to register commands for guild", + guild.ID, ": ", err.Error(), ) } else { - logging.Info("Registered commands for guild %s", guild.ID) + logging.Info("Registered commands for guild ", guild.ID) registeredCommands[guild.ID] = cmds } } @@ -98,13 +99,13 @@ func deregisterCommands(s *discordgo.Session) { cmd.ID, ); err != nil { logging.Error( - "Failed to delete %s command (id: %s) from guild %s", - cmd.Name, cmd.ID, guild, + "Failed to delete", cmd.Name, "command (id:", cmd.ID, + ") from guild ", guild, ) } else { logging.Info( - "Deregistered command %s (id: %s) from guild %s", - cmd.Name, cmd.ID, guild, + "Deregistered command ", cmd.Name,"(id:", cmd.ID, + ") from guild ", guild, ) } }