|
1 | 1 | 'use strict';
|
2 | 2 |
|
3 | 3 | const { DiscordSnowflake } = require('@sapphire/snowflake');
|
4 |
| -const { ApplicationCommandOptionType } = require('discord-api-types/v10'); |
| 4 | +const { ApplicationCommandOptionType, ApplicationIntegrationType } = require('discord-api-types/v10'); |
5 | 5 | const isEqual = require('fast-deep-equal');
|
6 | 6 | const { ApplicationCommandPermissionsManager } = require('../managers/ApplicationCommandPermissionsManager.js');
|
7 | 7 | const { PermissionsBitField } = require('../util/PermissionsBitField.js');
|
@@ -445,7 +445,18 @@ class ApplicationCommand extends Base {
|
445 | 445 | command.descriptionLocalizations ?? command.description_localizations ?? {},
|
446 | 446 | this.descriptionLocalizations ?? {},
|
447 | 447 | ) ||
|
448 |
| - !isEqual(command.integrationTypes ?? command.integration_types ?? [], this.integrationTypes ?? []) || |
| 448 | + // [0] is the default value sent by Discord |
| 449 | + !isEqual( |
| 450 | + command.integrationTypes ?? |
| 451 | + command.integration_types ?? |
| 452 | + (this.client.application.integrationTypesConfig |
| 453 | + ? Object.keys(this.client.application.integrationTypesConfig) |
| 454 | + : [ApplicationIntegrationType.GuildInstall]), |
| 455 | + this.integrationTypes ?? |
| 456 | + (this.client.application.integrationTypesConfig |
| 457 | + ? Object.keys(this.client.application.integrationTypesConfig) |
| 458 | + : [ApplicationIntegrationType.GuildInstall]), |
| 459 | + ) || |
449 | 460 | !isEqual(command.contexts ?? [], this.contexts ?? []) ||
|
450 | 461 | ('handler' in command && command.handler !== this.handler)
|
451 | 462 | ) {
|
|
0 commit comments