Represents the base class used for all our commands & components

Type Parameters

  • I extends BaseInteraction = BaseInteraction

Hierarchy (view full)

Constructors

Properties

_initialized: boolean = false
aliasOf: null | CommandType = null

Represents the command this command is an alias of

aliases: string[] = []

Represents a list of commands that are identical to the original command, with different names

category: null | string = null
client?: Client<boolean>
clientPerms: never[] = []
collection?: Collection<string, CommandType>
cooldown: CommandThrottle
deferReply: boolean = false
disabled: boolean = false
guildOnly: boolean = true
isEphemeral: boolean = false
manager?: CommandManager
nsfw: boolean = false
permLevel: PermLevel = PermLevel.User
requiredResourceIds: RequiredResources<I> = ...
sourceFile: string = DEFAULT_SOURCE_FILE_STRING
sourceFileStackTrace: string = DEFAULT_SOURCE_FILE_STRING
sourceHash: string = DEFAULT_SOURCE_FILE_STRING
userPerms: never[] = []

Accessors

Methods

  • Defers the reply to run interactions internally if possible

    Parameters

    • interaction: BaseInteraction<CacheType>

    Returns Promise<void>

  • Make sure the command matches all constraints - things like required Discord permissions, internal permissions, NSFW channels, etc.

    Parameters

    Returns Promise<boolean>

    True if the command matches all constraints (should execute), false otherwise

  • Parameters

    • interaction: I
    • client: Client<boolean>
    • targetMember: GuildMember | APIInteractionGuildMember
    • perms: PermissionsBitField[]

    Returns boolean

  • Convenience method to reply to an interaction and set ephemeral state dynamically - it's nice not having to boilerplate import everywhere

    Parameters

    Returns Promise<null | Message<boolean>>

  • Parameters

    • cmdName: string
    • cmdLocalizationKey: "name" | "description"

    Returns any

  • Throttle command usage, make sure we don't exceed the command's configured cooldown

    Parameters

    • interaction: I
    • client: Client<boolean>

    Returns boolean

    Wether or not the command is on cooldown for this interaction