Skip to content

Commit b0bce56

Browse files
committed
fix: default to client config and use enum
1 parent 0cbedd2 commit b0bce56

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

packages/discord.js/src/structures/ApplicationCommand.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22

33
const { DiscordSnowflake } = require('@sapphire/snowflake');
4-
const { ApplicationCommandOptionType } = require('discord-api-types/v10');
4+
const { ApplicationCommandOptionType, ApplicationIntegrationType } = require('discord-api-types/v10');
55
const isEqual = require('fast-deep-equal');
66
const Base = require('./Base');
77
const ApplicationCommandPermissionsManager = require('../managers/ApplicationCommandPermissionsManager');
@@ -419,7 +419,13 @@ class ApplicationCommand extends Base {
419419
this.descriptionLocalizations ?? {},
420420
) ||
421421
// [0] is the default value sent by Discord
422-
!isEqual(command.integrationTypes ?? command.integration_types ?? [0], this.integrationTypes ?? [0]) ||
422+
!isEqual(
423+
command.integrationTypes ??
424+
command.integration_types ??
425+
this.client.application.integrationTypesConfig?.keys() ?? [ApplicationIntegrationType.GuildInstall],
426+
this.integrationTypes ??
427+
this.client.application.integrationTypesConfig?.keys() ?? [ApplicationIntegrationType.GuildInstall],
428+
) ||
423429
!isEqual(command.contexts ?? [], this.contexts ?? [])
424430
) {
425431
return false;

0 commit comments

Comments
 (0)