The manager of items that belong to a list channel.

Example

new ListItemManager(channel);

Hierarchy

Constructors

Properties

cache: CacheCollection<string, ListItem>

This cache of the manager.

channel: ListChannel
client: Client

Methods

  • Add a item to the list channel.

    Returns

    The added item.

    Example

    items.add('Hello World!');
    

    Parameters

    • message: string

      The message of the item.

    • Optional note: string

      The note of the item.

    Returns Promise<ListItem>

  • Complete a item in the list channel.

    Example

    items.complete(item);
    

    Parameters

    • listItem: string | ListItem

      The item to complete.

    Returns Promise<void>

  • Edit a item in the list channel.

    Returns

    The edited item.

    Example

    items.edit(item, 'Hello World!');
    

    Parameters

    • listItem: string | ListItem

      The item to edit.

    • message: string

      The message of the item.

    • Optional note: string

      The note of the item.

    Returns Promise<ListItem>

  • Fetch a item from the list channel, or cache.

    Returns

    The fetched item.

    Example

    items.fetch(item);
    

    Parameters

    • listItem: string | ListItem

      The item to fetch.

    • Optional options: FetchOptions

      The options to fetch the item with.

    Returns Promise<ListItem>

  • Fetch items from the channel.

    Returns

    The fetched items.

    Example

    items.fetch();
    

    Parameters

    Returns Promise<Collection<string, ListItem>>

  • Remove a item in the list channel.

    Example

    items.remove(item);
    

    Parameters

    • listItem: string | ListItem

      The item to remove.

    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 ListItemManager

  • Uncomplete a item in the list channel.

    Example

    items.uncomplete(item);
    

    Parameters

    • listItem: string | ListItem

      The item to uncomplete.

    Returns Promise<void>