Represents a server member on Guilded.

Example

new ServerMember(server, rawMember);

Hierarchy

Constructors

Properties

client: Client
id: string
isOwner?: boolean

Whether the server member is the server owner.

joinedAt?: Date

The date the member joined the server.

nickname?: string

The nickname of the server member.

roleIds: number[]

The IDs of roles the server member has.

The manager of roles that belong to the server member.

server: Server
socialLinks: Collection<string, APISocialLink>

The social links of the server member.

user: User

The user the server member belongs to.

Accessors

  • get isCached(): boolean
  • Whether the server member is cached.

    Returns boolean

  • get joinedTimestamp(): undefined | number
  • The timestamp the member joined the server.

    Returns undefined | number

Methods

  • Award XP to the server member.

    Returns

    The total amount of XP the server member has.

    Example

    member.awardXp(100);
    

    Parameters

    • amount: number

      The amount of XP to award.

    Returns Promise<number>

  • Ban the server member.

    Returns

    The created server ban.

    Example

    member.ban();
    

    Parameters

    • Optional reason: string

      The reason of the ban.

    Returns Promise<ServerBan>

  • Fetch the server member.

    Returns

    The fetched server member.

    Example

    member.fetch();
    

    Parameters

    • Optional options: FetchOptions

      The options to fetch the server member with.

    Returns Promise<ServerMember>

  • Fetch a social link of the server member.

    Returns

    The fetched social link.

    Example

    member.fetchSocialLink('youtube');
    

    Parameters

    • type: string

      The type of social link to fetch.

    Returns Promise<APISocialLink>

  • Kick the server member.

    Returns

    The kicked member.

    Example

    member.kick();
    

    Returns Promise<ServerMember>

  • Remove the nickname of the server member.

    Returns

    The edited server member.

    Example

    member.removeNickname();
    

    Returns Promise<ServerMember>

  • Set the nickname of the server member.

    Returns

    The edited server member.

    Example

    member.setNickname('new nickname');
    

    Parameters

    • nickname: string

      The nickname of the server member.

    Returns Promise<ServerMember>

  • Set XP of the server member.

    Returns

    The total amount of XP the server member has.

    Example

    member.setXp(100);
    

    Parameters

    • amount: number

      The total XP of the server member.

    Returns Promise<number>

  • Unban the server member.

    Returns

    The unbanned member.

    Example

    member.unban();
    

    Returns Promise<ServerMember>