Options
Modules
  • Command
  • Localization
  • Logger
All
  • Public
  • Public/Protected
  • All
Menu

Container class that holds rules for controlling command execution or modifying command execution behavior. All rules in this class can also be imported directly by name from @discord-samba/command/rules

Hierarchy

  • Rules

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

Static checkMentionPrefix

checkMentionPrefix: RuleFunction = ...

This rule will check for a mention prefix on messages. Using this rule will enforce the usage of prefixes for all commands (except those triggered by regular expression or function trigger), but the check for whether a prefix was used does not occur until all rules have been run, so this rule will not interrupt command execution. This allows you to use additional rules to check for different kinds of prefixes as well. As long as at least one rule sets MessageContext#prefixUsed to true then the command will succeed (provided all other rules have passed as well)

Static disallowBots

disallowBots: RuleFunction = ...

This rule disallows bots from calling commands

Methods

Static allowOwner

  • This rule sets the provided user IDs as owners that are allowed to call commands that are marked as owner-only. This rule must be paired with the command middleware Middleware.ownerOnly which will make use of the owner IDs set by this rule.

    NOTE: This rule will only take effect the first time it is passed so be sure to include all owners you want to allow when setting this rule

    Parameters

    • Rest ...owners: string[]

    Returns RuleFunction

Generated using TypeDoc