Class GlobalMessageManager

Manager for handling caching and interactions for Messages

Hierarchy

Constructors

Properties

cache: Collection<string, Message> = ...
client: Client

Accessors

Methods

  • Adds a reaction to a message.

    Parameters

    • channelId: string

      The ID of the channel containing the message.

    • contentId: string

      The ID of the message to add a reaction to.

    • emoteId: number

      The ID of the emote to add as a reaction.

    Returns Promise<void>

    A promise that resolves to nothing when the reaction is added.

  • Deletes either a whole reaction emote from a message or a specific user's if a userId is provided.

    Parameters

    • channelId: string

      The ID of the channel containing the message.

    • contentId: string

      The ID of the message to delete the reaction from.

    • emoteId: number

      The ID of the emote to delete as a reaction.

    • Optional userId: string

    Returns Promise<void>

    A promise that resolves to nothing when the reaction is deleted.

  • Fetches a message from a channel.

    Parameters

    • channelId: string

      The ID of the channel to fetch the message from.

    • messageId: string

      The ID of the message to fetch.

    • Optional force: boolean

      Whether or not to force the fetch.

    Returns Promise<Message>

    A promise that resolves with the requested message.

  • Fetches multiple messages from a channel.

    Parameters

    • channelId: string

      The ID of the channel to fetch messages from.

    • options: Omit<{}, "channelId">

      Additional options for the fetch.

    Returns Promise<Collection<string, Message>>

    A promise that resolves with a collection of messages.

  • Sends a message to a channel.

    Example

    let replyObj = {
    content: 'This is text, supports **markdown**.',
    embeds: [{
    title: 'This is an embed title!',
    description: 'A description may go here'
    }]
    };
    await message.client.messages.send(message.channelId, replyObj)

    Parameters

    • channelId: string

      The ID of the channel to send the message to.

    • content: MessageContent

      The content of the message.

    Returns Promise<Message>

    A promise that resolves with the created message.

  • Updates a message in a channel.

    Parameters

    • channelId: string

      The ID of the channel containing the message.

    • messageId: string

      The ID of the message to update.

    • content: MessageContent

      The new content of the message.

    Returns Promise<Message>

    A promise that resolves with the updated message.

Generated using TypeDoc