Skip to content

Commit

Permalink
shorten method name
Browse files Browse the repository at this point in the history
  • Loading branch information
catplvsplus committed Nov 18, 2023
1 parent 9b309ab commit 92a040f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion example/modules/Utils/AddCommandHalts.js
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,14 @@ export class CommandPermissionsPrecondition extends CommandPrecondition {
return new PermissionsBitField(permissions?.missing(requiredPermissions));
}

/**
* @deprecated Use `isPermissionsPreconditionData` instead
*/
public static isCommandPermissionsPreconditionTriggerData<T extends AnyCommandExecuteData = AnyCommandExecuteData>(data: unknown): data is CommandPermissionsPreconditionTriggerData<T> {
return this.isPermissionsPreconditionData<T>(data);
}

public static isPermissionsPreconditionData<T extends AnyCommandExecuteData = AnyCommandExecuteData>(data: unknown): data is CommandPermissionsPreconditionTriggerData<T> {
return ((data as CommandPermissionsPreconditionTriggerData<T>).precondition instanceof CommandPermissionsPrecondition);
}

Expand Down

0 comments on commit 92a040f

Please sign in to comment.