@notenoughupdates/discord-akairo
Advanced tools
Comparing version 9.0.10-dev.1640800669.b25799e to 9.0.10-dev.1640801479.de050b5
{ | ||
"name": "@notenoughupdates/discord-akairo", | ||
"version": "9.0.10-dev.1640800669.b25799e", | ||
"version": "9.0.10-dev.1640801479.de050b5", | ||
"description": "A highly customizable bot framework for Discord.js.", | ||
@@ -5,0 +5,0 @@ "main": "./dist/src/index.js", |
@@ -189,4 +189,6 @@ "use strict"; | ||
type | ||
})); | ||
const currentGlobalCommands = (await this.client.application?.commands.fetch()).map(value1 => ({ | ||
})) | ||
.sort((a, b) => a.name.localeCompare(b.name)); | ||
const currentGlobalCommands = (await this.client.application?.commands.fetch()) | ||
.map(value1 => ({ | ||
name: value1.name, | ||
@@ -197,3 +199,4 @@ description: value1.description, | ||
type: value1.type | ||
})); | ||
})) | ||
.sort((a, b) => a.name.localeCompare(b.name)); | ||
if (!Util_js_1.default.deepEquals(currentGlobalCommands, slashCommandsApp)) { | ||
@@ -225,3 +228,5 @@ this.client.emit("akairoDebug", "[registerInteractionCommands] Updating global interaction commands.", slashCommandsApp); | ||
return; | ||
const currentGuildCommands = (await guild.commands.fetch()).map(value1 => ({ | ||
const sortedCommands = value.sort((a, b) => a.name.localeCompare(b.name)); | ||
const currentGuildCommands = (await guild.commands.fetch()) | ||
.map(value1 => ({ | ||
name: value1.name, | ||
@@ -232,8 +237,9 @@ description: value1.description, | ||
type: value1.type | ||
})); | ||
if (!Util_js_1.default.deepEquals(currentGuildCommands, value)) { | ||
this.client.emit("akairoDebug", `[registerInteractionCommands] Updating guild commands for ${guild.name}.`, value); | ||
await guild.commands.set(value).catch(error => { | ||
})) | ||
.sort((a, b) => a.name.localeCompare(b.name)); | ||
if (!Util_js_1.default.deepEquals(currentGuildCommands, sortedCommands)) { | ||
this.client.emit("akairoDebug", `[registerInteractionCommands] Updating guild commands for ${guild.name}.`, sortedCommands); | ||
await guild.commands.set(sortedCommands).catch(error => { | ||
if (error instanceof discord_js_1.DiscordAPIError) | ||
throw new RegisterInteractionCommandError(error, "guild", value, guild); | ||
throw new RegisterInteractionCommandError(error, "guild", sortedCommands, guild); | ||
else | ||
@@ -240,0 +246,0 @@ throw error; |
{ | ||
"name": "@notenoughupdates/discord-akairo", | ||
"version": "9.0.10-dev.1640800669.b25799e", | ||
"version": "9.0.10-dev.1640801479.de050b5", | ||
"description": "A highly customizable bot framework for Discord.js.", | ||
@@ -5,0 +5,0 @@ "main": "./dist/src/index.js", |
@@ -433,10 +433,13 @@ import { | ||
type | ||
})); | ||
const currentGlobalCommands = (await this.client.application?.commands.fetch())!.map(value1 => ({ | ||
name: value1.name, | ||
description: value1.description, | ||
options: value1.options, | ||
defaultPermission: value1.defaultPermission, | ||
type: value1.type | ||
})); | ||
})) | ||
.sort((a, b) => a.name.localeCompare(b.name)); | ||
const currentGlobalCommands = (await this.client.application?.commands.fetch())! | ||
.map(value1 => ({ | ||
name: value1.name, | ||
description: value1.description, | ||
options: value1.options, | ||
defaultPermission: value1.defaultPermission, | ||
type: value1.type | ||
})) | ||
.sort((a, b) => a.name.localeCompare(b.name)); | ||
@@ -462,2 +465,3 @@ if (!Util.deepEquals(currentGlobalCommands, slashCommandsApp)) { | ||
} | ||
if (guildSlashCommandsParsed.size) { | ||
@@ -468,14 +472,23 @@ guildSlashCommandsParsed.each(async (value, key) => { | ||
const currentGuildCommands = (await guild.commands.fetch()).map(value1 => ({ | ||
name: value1.name, | ||
description: value1.description, | ||
options: value1.options, | ||
defaultPermission: value1.defaultPermission, | ||
type: value1.type | ||
})); | ||
const sortedCommands = value.sort((a, b) => a.name.localeCompare(b.name)); | ||
if (!Util.deepEquals(currentGuildCommands, value)) { | ||
this.client.emit("akairoDebug", `[registerInteractionCommands] Updating guild commands for ${guild.name}.`, value); | ||
await guild.commands.set(value).catch(error => { | ||
if (error instanceof DiscordAPIError) throw new RegisterInteractionCommandError(error, "guild", value, guild); | ||
const currentGuildCommands = (await guild.commands.fetch()) | ||
.map(value1 => ({ | ||
name: value1.name, | ||
description: value1.description, | ||
options: value1.options, | ||
defaultPermission: value1.defaultPermission, | ||
type: value1.type | ||
})) | ||
.sort((a, b) => a.name.localeCompare(b.name)); | ||
if (!Util.deepEquals(currentGuildCommands, sortedCommands)) { | ||
this.client.emit( | ||
"akairoDebug", | ||
`[registerInteractionCommands] Updating guild commands for ${guild.name}.`, | ||
sortedCommands | ||
); | ||
await guild.commands.set(sortedCommands).catch(error => { | ||
if (error instanceof DiscordAPIError) | ||
throw new RegisterInteractionCommandError(error, "guild", sortedCommands, guild); | ||
else throw error; | ||
@@ -482,0 +495,0 @@ }); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
910438
16323