diff --git a/package.json b/package.json index eedc213..ba66693 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "djs-marshal", "description": "A simple slash command manager for typescript", - "version": "1.3.1", + "version": "1.3.2", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "https://github.com/DeathVenom54/djs-marshal.git", diff --git a/src/core/commands/syncCommands.ts b/src/core/commands/syncCommands.ts index a881667..31ec6d9 100644 --- a/src/core/commands/syncCommands.ts +++ b/src/core/commands/syncCommands.ts @@ -51,7 +51,7 @@ const setPermissions = async (registered: ApplicationCommand, command: SlashComm const syncGlobalCommands = async (application: ClientApplication, newCommands: SlashCommand[]): Promise => { logVerbose('Syncing global commands', application.client); const currentCommands = await application.commands.fetch(); - const cc = currentCommands.map((c) => toApplicationCommand(c)); + const cc = [...currentCommands.values()]; for (const command of newCommands) { if (!command.options?.length) command.options = []; @@ -68,7 +68,7 @@ const syncGlobalCommands = async (application: ClientApplication, newCommands: S // command has changed if (!deepEqual(matching, toApplicationCommand(command))) { logVerbose(`Syncing changed global command: ${command.name}`, application.client); - await application.commands.create(command); + await application.commands.edit(matching.id, command); } // finally, remove from synced commands