A user command requires this command class!

import { CommandContext, UserCommand } from "discord-interactionhandler-js";

class UCommand extends UserCommand {
get name() {
return "user";
}

get description() {
return "This is a user command!"
}

get version() {
return "1.0.0";
}

async run(ctx: CommandContext) {

}
}

Hierarchy (view full)

Constructors

Accessors

  • get description(): string
  • This function set the command description!

    Returns string

    The function must be return a string!

  • get guildOnly(): boolean
  • This function restrict the command usage to guilds only!

    Returns boolean

    The function must be return a boolean!

    false
    
  • get version(): string
  • This function set the version of the command!

    Returns string

    The function must be return a string!

    "1.0.0"
    

Methods

  • This function can be used in to send a error message in discord!

    Parameters

    • interaction: CommandInteraction<CacheType>
    • error: string

    Returns Promise<InteractionResponse<boolean>>

    The function returns the error reply!