The manager of messages that belong to a chat based channel.

Example

new MessageManager(channel);

Hierarchy

Constructors

Properties

Methods

Constructors

Properties

cache: CacheCollection<string, Message>

This cache of the manager.

channel: ChatChannel
client: Client

Methods

  • Create a message in the chat based channel.

    Returns

    The created message.

    Example

    messages.create('Hello world!');
    

    Parameters

    Returns Promise<Message>

  • Delete a message in the chat based channel.

    Example

    messages.delete(message);
    

    Parameters

    • message: string | Message

      The message to delete.

    Returns Promise<void>

  • Edit a message in the chat based channel.

    Returns

    The edited message.

    Example

    messages.edit(message, 'Hello world!');
    

    Parameters

    Returns Promise<Message>

  • Fetch a message from the chat based channel, or cache.

    Returns

    The fetched message.

    Example

    messages.fetch(message);
    

    Parameters

    • message: string | Message

      The message to fetch.

    • Optional options: FetchOptions

      The options to fetch the message with.

    Returns Promise<Message>

  • Fetch messages from the chat based channel.

    Returns

    The fetched messages.

    Example

    messages.fetch();
    

    Parameters

    Returns Promise<Collection<string, Message>>

  • Set the maximum cache size of the manager.

    Returns

    The manager.

    Example

    manager.setMaxCache(100);
    

    Parameters

    • maxSize: number

      The maximum size of the cache.

    Returns MessageManager