The manager of members that belong to a server.

Example

new ServerMemberManager(server);

Hierarchy

Constructors

Properties

This cache of the manager.

client: Client
server: Server

Methods

  • Award XP to a member in the server.

    Returns

    The total amount of XP the server member has.

    Example

    members.awardXp(member, 100);
    

    Parameters

    • member: string | ServerMember

      The member to award XP to.

    • amount: number

      The amount of XP to award to the member.

    Returns Promise<number>

  • Ban a member from the server.

    Returns

    The created ban.

    Example

    members.ban(member);
    

    Parameters

    • member: string | ServerMember

      The member to ban.

    • Optional reason: string

      The reason of the ban.

    Returns Promise<ServerBan>

  • Fetch a member from the server, or cache.

    Returns

    The fetched member.

    Example

    members.fetch(member);
    

    Parameters

    • member: string | ServerMember

      The member to fetch.

    • Optional options: FetchOptions

      The options to fetch the member with.

    Returns Promise<ServerMember>

  • Fetch members from the server.

    Returns

    The fetched members.

    Example

    members.fetch();
    

    Parameters

    Returns Promise<Collection<string, ServerMember>>

  • Fetch a social link from a member in the server.

    Returns

    The fetched social link.

    Example

    members.fetchSocialLink(member, 'youtube');
    

    Parameters

    • member: string | ServerMember

      The member to fetch the social link from.

    • type: string

      The type of social link to fetch.

    Returns Promise<APISocialLink>

  • Kick a member from the server.

    Example

    members.kick(member);
    

    Parameters

    Returns Promise<void>

  • Remove the nickname of a member in the server.

    Example

    members.removeNickname(member);
    

    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 ServerMemberManager

  • Set the nickname of a member in the server.

    Returns

    The nickname of the member.

    Example

    members.setNickname(member, 'new nickname');
    

    Parameters

    • member: string | ServerMember

      The member to edit.

    • nickname: string

      The nickname of the member.

    Returns Promise<string>

  • Set XP of a member in the server.

    Returns

    The total amount of XP the server member has.

    Example

    members.setXp(member, 100);
    

    Parameters

    • member: string | ServerMember

      The member to set XP for.

    • amount: number

      The total XP of the server member.

    Returns Promise<number>

  • Unban a member from the server.

    Example

    members.unban(member);
    

    Parameters

    Returns Promise<void>