Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents a message that was sent in a chatroom

Hierarchy

Indexable

[x: string]: unknown

Index

Constructors

  • summary

    Creates an instance of Message.

    Parameters

    • client: Client

      The client associated with this message (undefined if not a message type)

    • id: undefined | number

      The ID of the message

    • attrs: Partial<ITranscriptData> = {}

      Extra attributes that should be assigned to this message

    Returns Message

Properties

id: undefined | number

Accessors

  • get content(): Promise<string>
  • The actual text content of the message. This will be raw HTML as parsed by the server

    readonly
    memberof

    Message

    Returns Promise<string>

  • get parentMessageId(): Promise<number>
  • get room(): Promise<Room>
  • The room associated with this message

    readonly
    memberof

    Message

    Returns Promise<Room>

  • get roomId(): Promise<number>
  • The room ID associated with this message

    readonly
    memberof

    Message

    Returns Promise<number>

  • get user(): Promise<User>
  • The user associated with this message

    readonly
    memberof

    Message

    Returns Promise<User>

Methods

  • parent(): Promise<undefined | Message>
  • Fetches the parent message from this message, or undefined if there is no message

    memberof

    Message

    Returns Promise<undefined | Message>

    Promise

  • reply(message: string): Promise<Message>
  • Send a reply to this message, replying to the user (This will ping the user)

    throws

    {InvalidArgumentError} If message > 500 character, empty, or isn't a string.

    memberof

    Message

    Parameters

    • message: string

      The message to send

    Returns Promise<Message>

    A promise that contains the Message object that was sent

Generated using TypeDoc