form: add captcha regen button

lots of false negatives so this is a solution for now.

Also the registering of each discord command is now logged for debugging
purposes.
This commit is contained in:
Harvey Tindall
2022-01-26 22:14:16 +00:00
parent 15e5564b12
commit 4b02960fd1
4 changed files with 23 additions and 14 deletions
+13 -11
View File
@@ -310,19 +310,21 @@ func (d *DiscordDaemon) registerCommands() {
i++
}
d.deregisterCommands()
// d.deregisterCommands()
d.commandIDs = make([]string, len(commands))
cCommands, err := d.bot.ApplicationCommandBulkOverwrite(d.bot.State.User.ID, d.guildID, commands)
if err != nil {
d.app.err.Printf("Discord: Cannot create commands: %v", err)
}
for i, cmd := range cCommands {
// command, err := d.bot.ApplicationCommandCreate(d.bot.State.User.ID, d.guildID, cmd)
// if err != nil {
// d.app.err.Printf("Discord: Cannot create command \"%s\": %v", cmd.Name, err)
// }
d.commandIDs[i] = cmd.ID
// cCommands, err := d.bot.ApplicationCommandBulkOverwrite(d.bot.State.User.ID, d.guildID, commands)
// if err != nil {
// d.app.err.Printf("Discord: Cannot create commands: %v", err)
// }
for i, cmd := range commands {
command, err := d.bot.ApplicationCommandCreate(d.bot.State.User.ID, d.guildID, cmd)
if err != nil {
d.app.err.Printf("Discord: Cannot create command \"%s\": %v", cmd.Name, err)
} else {
d.app.debug.Printf("Discord: registered command \"%s\"", cmd.Name)
d.commandIDs[i] = command.ID
}
}
}