Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SystemMessageManager

Stores configuration and generates system messages

System messages - predefined messages sent by the bot in special cases (for example after an error, or when a command doesn't exist)

remarks

You can't customize messages after starting the bot. Changing these properties while the bot is running will have no effect.

Hierarchy

  • SystemMessageManager

Index

Constructors

constructor

Properties

ERROR

Sent when an error occurs during the execution of a command

NOT_FOUND

Sent when someone tries to run a command that does not exist (mainly by using prefix interactions)

PERMISSION

Sent whenever caller's permissions are not sufficient to run a command

SUCCESS

Sent when a command function returns void without throwing an error

remarks

An announceSuccess property must be set to true (default) in order to send this message

Readonly client

client: Bot

Client parent attached to this manager

readonly

deleteTimeout

deleteTimeout: number

Global time (in ms) after a message gets deleted

remarks

This time applies to all message types but it can be overwritten using local properties with the same name (for example ERROR.deleteTimeout)

Methods

send

  • send(type: MessageType, data?: SystemMessageData, interaction?: Message | Interaction | TextChannel | DMChannel): Promise<void | Message | MessageEmbed>
  • Generates and sends a system message

    async

    Parameters

    • type: MessageType

      "ERROR" | "PERMISSION" | "NOT_FOUND" | "SUCCESS"

    • Optional data: SystemMessageData
    • Optional interaction: Message | Interaction | TextChannel | DMChannel

    Returns Promise<void | Message | MessageEmbed>

    A message that got sent or void

Generated using TypeDoc