mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 20:43:30 +01:00
fix(ApplicationCommand): Remove autocomplete check at the top level and correctly check for dmPermission (#8100)
This commit is contained in:
@@ -352,6 +352,7 @@ class ApplicationCommand extends Base {
|
|||||||
if (command.id && this.id !== command.id) return false;
|
if (command.id && this.id !== command.id) return false;
|
||||||
|
|
||||||
let defaultMemberPermissions = null;
|
let defaultMemberPermissions = null;
|
||||||
|
let dmPermission = command.dmPermission ?? command.dm_permission;
|
||||||
|
|
||||||
if ('default_member_permissions' in command) {
|
if ('default_member_permissions' in command) {
|
||||||
defaultMemberPermissions = command.default_member_permissions
|
defaultMemberPermissions = command.default_member_permissions
|
||||||
@@ -370,13 +371,12 @@ class ApplicationCommand extends Base {
|
|||||||
command.name !== this.name ||
|
command.name !== this.name ||
|
||||||
('description' in command && command.description !== this.description) ||
|
('description' in command && command.description !== this.description) ||
|
||||||
('version' in command && command.version !== this.version) ||
|
('version' in command && command.version !== this.version) ||
|
||||||
('autocomplete' in command && command.autocomplete !== this.autocomplete) ||
|
|
||||||
(command.type && command.type !== this.type) ||
|
(command.type && command.type !== this.type) ||
|
||||||
// Future proof for options being nullable
|
// Future proof for options being nullable
|
||||||
// TODO: remove ?? 0 on each when nullable
|
// TODO: remove ?? 0 on each when nullable
|
||||||
(command.options?.length ?? 0) !== (this.options?.length ?? 0) ||
|
(command.options?.length ?? 0) !== (this.options?.length ?? 0) ||
|
||||||
defaultMemberPermissions !== (this.defaultMemberPermissions?.bitfield ?? null) ||
|
defaultMemberPermissions !== (this.defaultMemberPermissions?.bitfield ?? null) ||
|
||||||
command.dmPermission !== this.dmPermission ||
|
(typeof dmPermission !== 'undefined' && dmPermission !== this.dmPermission) ||
|
||||||
!isEqual(command.nameLocalizations ?? command.name_localizations ?? {}, this.nameLocalizations ?? {}) ||
|
!isEqual(command.nameLocalizations ?? command.name_localizations ?? {}, this.nameLocalizations ?? {}) ||
|
||||||
!isEqual(
|
!isEqual(
|
||||||
command.descriptionLocalizations ?? command.description_localizations ?? {},
|
command.descriptionLocalizations ?? command.description_localizations ?? {},
|
||||||
|
|||||||
Reference in New Issue
Block a user