diff --git a/example/modules/Utils/AddCommandHalts.js b/example/modules/Utils/AddCommandHalts.js index 402bddda..9e96d953 100644 --- a/example/modules/Utils/AddCommandHalts.js +++ b/example/modules/Utils/AddCommandHalts.js @@ -90,7 +90,7 @@ export default { createResponse(replyOptions); return true; case CommandHaltReason.PreconditionTrigger: - if (CommandPermissionsPrecondition.isCommandPermissionsPreconditionTriggerData(haltData.data)) { + if (CommandPermissionsPrecondition.isPermissionsPreconditionData(haltData.data)) { preconditionSwitch: switch (haltData.data.data?.type) { case CommandPermissionsPreconditionTriggerDataType.BotNotAllowed: return true; case CommandPermissionsPreconditionTriggerDataType.ClientNotEnoughPermissions: diff --git a/packages/core/src/classes/preconditions/CommandPermissionsPrecondition.ts b/packages/core/src/classes/preconditions/CommandPermissionsPrecondition.ts index 5b41cc5a..9f30cf4b 100644 --- a/packages/core/src/classes/preconditions/CommandPermissionsPrecondition.ts +++ b/packages/core/src/classes/preconditions/CommandPermissionsPrecondition.ts @@ -118,7 +118,14 @@ export class CommandPermissionsPrecondition extends CommandPrecondition { return new PermissionsBitField(permissions?.missing(requiredPermissions)); } + /** + * @deprecated Use `isPermissionsPreconditionData` instead + */ public static isCommandPermissionsPreconditionTriggerData(data: unknown): data is CommandPermissionsPreconditionTriggerData { + return this.isPermissionsPreconditionData(data); + } + + public static isPermissionsPreconditionData(data: unknown): data is CommandPermissionsPreconditionTriggerData { return ((data as CommandPermissionsPreconditionTriggerData).precondition instanceof CommandPermissionsPrecondition); }