Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Properties

Optional aliases

aliases: string[]

The aliases of the command.

arguments

arguments: Record<string, Argument<any>> = {}

The arguments of the command. You can put your own custom arguments but you must add the type to the argument types.

Optional category

category: string

The category of the command.

defaultvalue

The command parent directory.

Optional channels

channels: (string | TextChannel)[]

The channels where the command should only be executed if used (if using the default message event).

Optional clientPermissions

clientPermissions: string[]

The client permissions needed to run the command (if using the default message event).

defaultvalue

['SEND_MESSAGES']

Optional cooldown

cooldown: number

The cooldown of the command in seconds.

defaultvalue

0

remarks

Every cooldown should be saved in CommandHandler.cooldowns.

Optional description

description: string

The description of the command.

Readonly Abstract name

name: string

The name of the command.

subCommands

subCommands: SubCommand[] = []

The SubCommands of this command.

remarks

Register SubCommands using the {@link Command#registerSubCommands} method.

Optional tags

tags: string[]

The tags of the command.

remarks

How tags works ?

see

Tag

Optional usage

usage: string

The usage of the command.

example
userinfo
userinfo me
userinfo <ID/Username/Mention of User>
remarks

If no value is set, in most places it will use the result of the {@link Command#signatures} method.

Optional userPermissions

userPermissions: string[]

The user permissions needed to run the command (if using the default message event).

defaultvalue

['SEND_MESSAGES']

waitEmoji

waitEmoji: string = ':hourglass_flowing_sand:'

The emoji for waiting.

remarks

Feel free to modify the emoji to use a custom one.

Constructors

constructor

Methods

deleteMessage

execute

getCooldown

  • getCooldown(from: string | Message | User | GuildMember): Cooldown
  • Get the actual cooldown of the user for this command plus when command has been executed and how many seconds to wait.

    Parameters

    • from: string | Message | User | GuildMember

      Where to get the cooldown from, can be a user/guild/message, see types.

    Returns Cooldown

    • The user's cooldown.

getInvalidPermissions

  • getInvalidPermissions(): { client: string[]; user: string[] }

getMissingPermissions

getMissingTags

isInCooldown

  • isInCooldown(from: string | Message | User | GuildMember): boolean
  • Returns true if the user is in a cooldown for this command.

    remarks

    If cooldown not set, this will always return false.

    Parameters

    • from: string | Message | User | GuildMember

      From where to test if user/guild/message is in a cooldown, see types.

    Returns boolean

    • Is user in a cooldown.

isInRightChannel

Optional registerSubCommands

  • registerSubCommands(): any

Abstract run

setCooldown

  • setCooldown(from: string | Message | User | GuildMember): void

signature

  • Get the signature of this command.

    example

    // The help command with an optional command commandArgument argument.

    help [command]
    

    Parameters

    • Optional options: CommandSignatureOptions

      The options for the signature, show the type of the arguments or the default values.

    Returns string

    • The signature of this command or subCommand.

signatures

  • Returns the signature of the command plus the signature of the subCommands of this command.

    example

    // The help command with an optional command commandArgument argument and a all subCommand with no arguments.

    help [command]
    help all
    

    Parameters

    • Optional options: CommandSignatureOptions

      The options for the signature, show the type of the arguments or the default values.

    Returns string

    • The signatures of the command.

startWait

stopWait

validate

Protected subCommand

Accessors

nameAndAliases

  • get nameAndAliases(): string[]

subCommandsNamesAndAliases

  • get subCommandsNamesAndAliases(): string[]

Generated using TypeDoc