The manager of topics that belong to a forum channel.

Example

new ForumTopicManager(channel);

Hierarchy

Constructors

Properties

cache: CacheCollection<number, ForumTopic>

This cache of the manager.

channel: ForumChannel
client: Client

Methods

  • Create a topic in the forum channel.

    Returns

    The created forum topic.

    Example

    topics.create({ title: 'My Topic' });
    

    Parameters

    Returns Promise<ForumTopic>

  • Delete a forum topic from the channel.

    Example

    topics.delete(forumTopic);
    

    Parameters

    • forumTopic: number | ForumTopic

      The forum topic to delete.

    Returns Promise<void>

  • Edit a forum topic in the channel.

    Returns

    The edited forum topic.

    Example

    topics.edit(forumTopic, { title: 'My Topic' });
    

    Parameters

    Returns Promise<ForumTopic>

  • Fetch a forum topic from the channel, or cache.

    Returns

    The fetched forum topic.

    Example

    topics.fetch(forumTopic);
    

    Parameters

    • forumTopic: number | ForumTopic

      The forum topic to fetch.

    • Optional options: FetchOptions

      The options to fetch the forum topic with.

    Returns Promise<ForumTopic>

  • Fetch forum topics from the channel.

    Returns

    The fetched forum topics.

    Example

    topics.fetch();
    

    Parameters

    Returns Promise<Collection<number, ForumTopic>>

  • Lock a forum topic in the channel.

    Example

    topics.lock(forumTopic);
    

    Parameters

    • forumTopic: number | ForumTopic

      The forum topic to lock.

    Returns Promise<void>

  • Pin a forum topic in the channel.

    Example

    topics.pin(forumTopic);
    

    Parameters

    • forumTopic: number | ForumTopic

      The forum topic to pin.

    Returns Promise<void>

  • 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 ForumTopicManager

  • Unlock a forum topic in the channel.

    Example

    topics.unlock(forumTopic);
    

    Parameters

    • forumTopic: number | ForumTopic

      The forum topic to unlock.

    Returns Promise<void>

  • Unpin a forum topic from the channel.

    Example

    topics.unpin(forumTopic);
    

    Parameters

    • forumTopic: number | ForumTopic

      The forum topic to unpin.

    Returns Promise<void>