Class GlobalMemberManager

A class representing a manager for Discord server members.

Hierarchy

Constructors

Properties

cache: Collection<string, Member> = ...
client: Client

Accessors

Methods

  • Bans a member from a server.

    Parameters

    • serverId: string

      The ID of the server to ban the member from.

    • userId: string

      The ID of the user to ban.

    Returns Promise<null | MemberBan>

    A Promise that resolves with the banned member, or null if the member was not cached.

  • Fetches a member from a server.

    Parameters

    • serverId: string

      The ID of the server to fetch the member from.

    • userId: string

      The ID of the member to fetch.

    • Optional force: boolean

      Whether to force a fetch from the API.

    Returns Promise<Member>

    A Promise that resolves with the fetched member.

  • Fetches all members from a server. Returned objects are partial members.

    Parameters

    • serverId: string

      The ID of the server to fetch members from.

    Returns Promise<Collection<string, PartialMember>>

    A Promise that resolves with a collection of partial members.

  • Fetch a member's social links.

    Parameters

    • serverId: string

      The ID of the server.

    • userId: string

      The ID of the member.

    • type: "twitch" | "bnet" | "psn" | "xbox" | "steam" | "origin" | "youtube" | "twitter" | "facebook" | "switch" | "patreon" | "roblox" | "epic"

      The type of social link to fetch.

    Returns Promise<SocialLinkPayload>

    A Promise that resolves with the member's social link.

  • Gets a list of the roles assigned to a member using the ID of the member.

    Parameters

    • serverId: string

      The ID of the server to get the member roles from.

    • userId: string

      The ID of the member to get the roles for.

    Returns Promise<number[]>

    A Promise that resolves with an array of role IDs.

  • Awards XP to a member.

    Parameters

    • serverId: string

      The ID of the server to award XP on.

    • userId: string

      The ID of the member to award XP to.

    • amount: number

      The amount of XP to award.

    Returns Promise<number>

    A Promise that resolves with the member's new total XP.

  • Kicks a member from a server.

    Parameters

    • serverId: string

      The ID of the server to kick the member from.

    • userId: string

      The ID of the member to kick.

    Returns Promise<null | Member>

    A Promise that resolves with the kicked member, or null if the member was not cached.

  • Deletes a member's nickname.

    Parameters

    • serverId: string

      The ID of the server to delete the member nickname from.

    • userId: string

      The ID of the member to delete the nickname for.

    Returns Promise<void>

    A Promise that resolves with no value upon completion.

  • Unbans a user from a server.

    Parameters

    • serverId: string

      The ID of the server.

    • userId: string

      The ID of the user.

    • removeBanIfCached: boolean = false

      Whether to remove the ban from the cache if it exists.

    Returns Promise<null | MemberBan>

    A Promise that resolves with the unbanned member ban or null if it isn't cached.

  • Updates a member's nickname. Returns the new name.

    Parameters

    • serverId: string

      The ID of the server to update the member nickname for.

    • userId: string

      The ID of the member to update the nickname for.

    • newNickname: string

      The new nickname for the member.

    Returns Promise<string>

    A Promise that resolves with the updated nickname.

Generated using TypeDoc