The manager of bans that belong to a server.

Example

new ServerBanManager(server);

Hierarchy

Constructors

Properties

Methods

Constructors

Properties

cache: CacheCollection<string, ServerBan>

This cache of the manager.

client: Client
server: Server

Methods

  • Create a ban in the server.

    Returns

    The created ban.

    Example

    bans.create(member);
    

    Parameters

    • member: string | ServerMember

      The member the ban belongs to.

    • Optional reason: string

      The reason of the ban.

    Returns Promise<ServerBan>

  • Fetch a ban from the server, or cache.

    Returns

    The fetched ban.

    Example

    bans.fetch(ban);
    

    Parameters

    • ban: string | ServerBan

      The ban to fetch.

    • Optional options: FetchOptions

      The options to fetch the ban with.

    Returns Promise<ServerBan>

  • Fetch bans from thw server.

    Returns

    The fetched bans.

    Example

    bans.fetch();
    

    Parameters

    Returns Promise<Collection<string, ServerBan>>

  • Remove a ban in the server.

    Example

    bans.remove(ban);
    

    Parameters

    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 ServerBanManager