Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Command

Hierarchy

  • Command

Index

Properties

Readonly _throttlingIncludeAdmins

_throttlingIncludeAdmins: boolean

Either or not this command's throttler also includes users with administrator permission.

Readonly aliases

aliases: readonly string[]

Aliases of this command.

Readonly args

args: ReadonlyMap<string, ArgDefinition>

A ReadonlyMap with this command's arguments' ArgDefinition

Readonly clientPermissions

clientPermissions: readonly PermissionString[]

The list of permissions the bot's user require to execute this command.

Readonly commandSet

commandSet: CommandSet

The CommandSet that contains this command.

Readonly deleteMessage

deleteMessage: boolean

Either or not the message that executed this command is deleted after the command execution.

Readonly description

description: string

The description of the command.

Readonly devOnly

devOnly: boolean

Either or not this command can only be used by dev (see CommandSetOptions.devIDs).

Readonly examples

examples: readonly string[]

The list of exemples for this command.

Readonly filepath

filepath: string | null

Path to the file that contains the command if it's a top-most command, null otherwise.

Readonly flags

flags: ReadonlyMap<string, FlagDefinition>

A ReadonlyMap with this command's flags' FlagDefinition

Readonly guildOnly

guildOnly: boolean

Either or not this command can only be used from a guild.

Readonly ignored

ignored: boolean

Either or not this command is ignored.

Readonly name

name: string

Name of this command.

Readonly parent

parent: Command | null

This command's parent or null if it's a top-most command.

Readonly rest

rest: Readonly<RestDefinition> | undefined

A RestDefinition if this command use the rest argument, undefined otherwise.

Readonly subs

A ReadonlyCommandCollection of this command's sub-commands.

Readonly userPermissions

userPermissions: readonly PermissionString[] | undefined

The list of permissions the user require to execute this command.

Accessors

hasExecutor

  • get hasExecutor(): boolean

throttler

Methods

canUse

  • canUse(user: User, message: Message): boolean | string
  • Call the canUse handler of this command and its parents (see [[CommandDefinition.canUse]]) and return the first negative result (false or a string) or true.

    Parameters

    • user: User
    • message: Message

    Returns boolean | string

    Result of canUse handlers.

checkPermissions

  • checkPermissions(message: Message): boolean

getParents

  • Returns an array containing all parents of this command, ordered from top-most command to this command (included).

    Returns Command[]

    An array of this command's parent Command.

hasClientPermissions

  • hasClientPermissions(guild: Guild): boolean
  • Determines if the bot's user have required permissions to execute this command from the guild.

    Parameters

    • guild: Guild

      The guild from which check permissions.

    Returns boolean

    Either or not the bot's user have required permissions to execute this command from the guild.

hasPermissions

  • hasPermissions(member: GuildMember): boolean
  • Determines if a member have required permissions to execute this command.

    Parameters

    • member: GuildMember

    Returns boolean

    Either or not the member have required permissions to execute this command.

help

Generated using TypeDoc