Represents a message on Guilded.

Example

new Message(channel, rawMessage);

Hierarchy

Constructors

Properties

channel: ChatChannel
channelId: string

The ID of the channel the message belongs to.

client: Client
content?: string

The content of the message.

createdAt: Date

The date the message was created.

createdBy: string

The ID of the user that created the message.

createdByWebhookId?: string

The ID of the webhook that created the message.

deletedAt?: Date

The date the message was deleted.

editedAt?: Date

The date the message was edited.

embeds: APIEmbed[]

The embeds in the message.

id: string
isPrivate?: boolean

Whether the message is private.

isSilent?: boolean

Whether the message is silent.

mentions?: APIMentions

The mentions of the message.

A manager of reactions that belong to the message.

replyMessageIds: string[]

The IDs of messages that were replied to.

serverId?: string

The ID of the server the message belongs to.

The type of the message.

Accessors

  • get author(): undefined | ServerMember
  • The server member that created the message.

    Returns undefined | ServerMember

  • get authorId(): string
  • The ID of the user that created the message.

    Returns string

  • get createdTimestamp(): number
  • The timestamp the message was created.

    Returns number

  • get deletedTimestamp(): undefined | number
  • The timestamp the message was deleted.

    Returns undefined | number

  • get editedTimestamp(): undefined | number
  • The timestamp the message was edited.

    Returns undefined | number

  • get group(): undefined | Group
  • The group the message belongs to.

    Returns undefined | Group

  • get isCached(): boolean
  • Whether the message is cached.

    Returns boolean

  • get isDefault(): boolean
  • Whether the message is a default message.

    Returns boolean

  • get isDeleted(): boolean
  • Whether the message is deleted.

    Returns boolean

  • get isEditable(): boolean
  • Whether the message is editable.

    Returns boolean

  • get isSystem(): boolean
  • Whether the message is a system message.

    Returns boolean

  • get replies(): Collection<string, Message>
  • The messages that were replied to.

    Returns Collection<string, Message>

  • get server(): undefined | Server
  • The server the message belongs to.

    Returns undefined | Server

  • get webhook(): undefined | Webhook
  • The webhook that created the message.

    Returns undefined | Webhook

Methods

  • Delete the message.

    Returns

    The deleted message.

    Example

    message.delete();
    

    Returns Promise<Message>

  • Fetch the message.

    Returns

    The fetched message.

    Example

    message.fetch();
    

    Parameters

    • Optional options: FetchOptions

      The options to fetch the message with.

    Returns Promise<Message>

  • Fetch the server member that created the message.

    Returns

    The fetched server member.

    Example

    message.fetchAuthor();
    

    Parameters

    • Optional options: FetchOptions

      The options to fetch the server member with.

    Returns Promise<ServerMember>

  • Fetch the group the message belongs to.

    Returns

    The fetched group.

    Example

    message.fetchGroup();
    

    Parameters

    • Optional options: FetchOptions

      The options to fetch the group with.

    Returns Group

  • Fetch the messages that were replied to.

    Returns

    The fetched messages.

    Parameters

    Returns Promise<Collection<string, Message>>

  • Fetch the server the message belongs to.

    Returns

    The fetched server.

    Example

    message.fetchServer();
    

    Parameters

    • Optional options: FetchOptions

      The options to fetch the server with.

    Returns Promise<Server>

  • Fetch the webhook that created the message.

    Returns

    The fetched webhook.

    Example

    message.fetchWebhook();
    

    Parameters

    • Optional options: FetchOptions

      The options to fetch the webhook with.

    Returns undefined | Promise<Webhook>

  • React to the message.

    Returns

    The message.

    Example

    message.react(123);
    

    Parameters

    • emojiId: number

      The ID of the emoji to react with.

    Returns Promise<Message>