Options
All
  • Public
  • Public/Protected
  • All
Menu

Class GuildMemberManager

Manages API methods for GuildMembers

Hierarchy

  • GuildMemberManager

Index

Constructors

Properties

All of the members the client is currently handling in this guild, mapped by their Ids

client: Client

The client that instantiated this Manager

guild: Guild

The Guild belonging to this manager

Methods

  • ban(id: string, options?: BanOptions): Promise<GuildBan>
  • Bans a user from the guild

    example
    guild.members.ban('123456789123456')
    
    example
    guild.members.ban('123456789123456', { reason: 'Spamming', days: 1 })
    

    Parameters

    • id: string
    • options: BanOptions = ...

      Options for the ban

    Returns Promise<GuildBan>

  • Edits a guild member

    example
    guild.members.edit('12345678901234567', { roles: ['12345678901234567'] })
    
    example
    guild.members.edit('12345678901234567', { nick: 'Veric', roles: ['2345678954234590'] })
    

    Parameters

    • userId: string

      The Id of the user to edit

    • data: GuildMemberEditData

      The data to edit the member with

    • reason: string = ''

      The reason for editing the member

    Returns Promise<GuildMember>

  • Fetches member(s) from this guild, even if they're offline

    Parameters

    • id: string

    Returns Promise<GuildMember>

  • Parameters

    • Optional id: string

    Returns Promise<Collection<string, GuildMember>>

  • kick(userId: string, reason?: string): Promise<undefined>
  • Kicks a user from the guild

    Parameters

    • userId: string

      The member to kick

    • reason: string = ''

      Reason for kicking

    Returns Promise<undefined>

  • Searches member(s) from this guild

    example
    guild.members.search('Bob', 10)
    

    Parameters

    • query: string = ''

      Query string to match username(s) and nickname(s) against

    • limit: number = 100

      Max number of members to return (1-1000). Default: 100

    Returns Promise<Collection<string, GuildMember>>

  • unban(id: string, reason?: string): Promise<undefined | User>
  • Unbans a user from the guild

    example
    guild.members.ban('123456789123456')
    
    • @example
    guild.bans.remove('123456789123456', 'Applied ban in the wrong user')
    

    Parameters

    • id: string
    • reason: string = ''

      Reason for unbanning

    Returns Promise<undefined | User>

Generated using TypeDoc version 0.22.16, the 9/16/2022 at 1:09:15 AM