Skip to content

Commit

Permalink
Fixed issue with slash commands not being registered
Browse files Browse the repository at this point in the history
  • Loading branch information
ire4ever1190 committed Oct 28, 2021
1 parent 0116edd commit 49d095b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dimscmd.nimble
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Package

version = "1.3.0"
version = "1.3.1"
author = "Jake Leahy"
description = "A command handler for the dimscord discord library"
license = "MIT"
Expand Down
4 changes: 2 additions & 2 deletions src/dimscmd.nim
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,8 @@ proc registerCommands*(handler: CommandHandler) {.async.} =
# Convert everything from internal Command type to discord ApplicationCommand type
for child in handler.slashCommands.children:
let guildID = child.getGuildID()
if commands.hasKeyOrPut(guildID, @[]):
commands[guildID] &= child.toApplicationCommand()
discard commands.hasKeyOrPut(guildID, @[])
commands[guildID] &= child.toApplicationCommand()
# Add the commands to their specific guilds
for guildID, cmds in commands.pairs():
discard await api.bulkOverwriteApplicationCommands(handler.applicationID, cmds, guildID = guildID)
Expand Down

0 comments on commit 49d095b

Please sign in to comment.