A validator class to verify if the information of a slash command valid and can be deployed.

Hierarchy

  • SlashCommandValidator

Constructors

Properties

DESC_MAX: number = 100
DESC_MIN: number = 1
NAME_MAX: number = 32
NAME_MIN: number = 1
NAME_REGEX: RegExp = ...

Methods

  • Validate a given slash command.

    Parameters

    Returns void

    Throws

    Throws if command name is too short or too long.

    Throws

    Throws if command name contains invalid characters (i.e. upper-cased characters).

    Throws

    Throws if command description is too short or too long.

    Throws

    Throws if any command alias is too short or too long.

    Throws

    Throws if any command alias contains invalid characters (i.e. upper-cased characters).

  • Validate the slash command's description.

    Parameters

    • description: string

    Returns void

    Throws

    Throws if command description is too short or too long.

  • Validate the slash command's name.

    Parameters

    • name: string

      The name of the slash command.

    Returns void

    Throws

    Throws if command name is too short or too long.

    Throws

    Throws if command name contains invalid characters (i.e. upper-cased characters).

Generated using TypeDoc