hoshii / Exports / ServerMember

ServerMember

Represents a user

Hierarchy

  • User

    ServerMember

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new ServerMember(data, client, serverID)

Create a new ServerMember

Parameters

NameTypeDescription
dataRawServerMemberThe raw data of the member
clientClientThe client
serverIDstringThe ID of the server the member is in

Overrides

User.constructor

Defined in

lib/structures/ServerMember.ts:68open in new window

Properties

_data

Private _data: RawServerMember

The raw data of the member

Defined in

lib/structures/ServerMember.ts:35open in new window


avatar

avatar: string

The avatar of the user

Inherited from

User.avatar

Defined in

lib/structures/User.ts:38open in new window


banner: string

The banner of the user

Inherited from

User.banner

Defined in

lib/structures/User.ts:43open in new window


bot

bot: boolean

Whether the user is a bot

Inherited from

User.bot

Defined in

lib/structures/User.ts:48open in new window


client

client: Client

The bot client

Inherited from

User.client

Defined in

lib/structures/Base.ts:13open in new window


createdAt

createdAt: Date

The date the user was created at

Inherited from

User.createdAt

Defined in

lib/structures/User.ts:53open in new window


id

id: string

The ID of the item

Inherited from

User.id

Defined in

lib/structures/Base.ts:16open in new window


isOwner

isOwner: boolean

Whether the member is the owner of the server

Defined in

lib/structures/ServerMember.ts:40open in new window


joinedAt

joinedAt: Date

The date the member joined the server

Defined in

lib/structures/ServerMember.ts:45open in new window


name

name: string

The name of the user

Inherited from

User.name

Defined in

lib/structures/User.ts:58open in new window


nickname

nickname: string

The nickname of the member

Defined in

lib/structures/ServerMember.ts:50open in new window


roleIDs

roleIDs: number[]

An array of role IDs the member has

Defined in

lib/structures/ServerMember.ts:55open in new window


serverID

serverID: string

The ID of the server the member is in

Defined in

lib/structures/ServerMember.ts:60open in new window


type

type: UserTypes

The type of the user

Inherited from

User.type

Defined in

lib/structures/User.ts:63open in new window

Accessors

server

get server(): Server | Promise<Server>

The server the member is in

Returns

Server | Promise<Server>

Defined in

lib/structures/ServerMember.ts:88open in new window


user

get user(): User

The user data of the member

Returns

User

Defined in

lib/structures/ServerMember.ts:98open in new window

Methods

addGroup

addGroup(groupID): Promise<void>

Add a member to a group

Parameters

NameTypeDescription
groupIDstringThe ID of the group

Returns

Promise<void>

Defined in

lib/structures/ServerMember.ts:115open in new window


addRole

addRole(roleID): Promise<void>

Add a role to a member

Parameters

NameTypeDescription
roleIDnumberThe ID of the role

Returns

Promise<void>

Defined in

lib/structures/ServerMember.ts:124open in new window


award

award(amount): Promise<number>

Award the member the built-in XP system

Parameters

NameTypeDescription
amountnumberThe amount of XP to award

Returns

Promise<number>

Defined in

lib/structures/ServerMember.ts:133open in new window


createBan

createBan(reason?): Promise<ServerMemberBan>

Create a ban for the member

Parameters

NameTypeDescription
reason?stringThe reason for the ban

Returns

Promise<ServerMemberBan>

Defined in

lib/structures/ServerMember.ts:141open in new window


edit

edit(options): Promise<void>

Edit the member

Parameters

NameTypeDescription
optionsServerMemberEditOptionsThe options to edit the member with

Returns

Promise<void>

Defined in

lib/structures/ServerMember.ts:154open in new window


getSocialLink(socialMediaName): Promise<SocialLink>

Get the social link of the member

Parameters

NameTypeDescription
socialMediaNamestringThe name of the social media

Returns

Promise<SocialLink>

Defined in

lib/structures/ServerMember.ts:163open in new window


remove

remove(): Promise<void>

Remove the member from the server

Returns

Promise<void>

Defined in

lib/structures/ServerMember.ts:175open in new window


removeBan

removeBan(): Promise<void>

Remove a member ban

Returns

Promise<void>

Defined in

lib/structures/ServerMember.ts:183open in new window


removeGroup

removeGroup(groupID): Promise<void>

Remove a member from a group

Parameters

NameTypeDescription
groupIDstringThe ID of the group

Returns

Promise<void>

Defined in

lib/structures/ServerMember.ts:192open in new window


removeRole

removeRole(roleID): Promise<void>

Remove a role from a member

Parameters

NameTypeDescription
roleIDnumberThe ID of the role

Returns

Promise<void>

Defined in

lib/structures/ServerMember.ts:201open in new window


setXP

setXP(total): Promise<number>

Set the member XP using the built-in XP system

Parameters

NameTypeDescription
totalnumberThe total XP to set

Returns

Promise<number>

Defined in

lib/structures/ServerMember.ts:214open in new window


toJSON

toJSON(): ServerMemberData

Returns the JSON representation of the item

Returns

ServerMemberData

Overrides

User.toJSON

Defined in

lib/structures/ServerMember.ts:218open in new window


update

Protected update(data): void

Parameters

NameType
dataRawServerMember

Returns

void

Overrides

User.update

Defined in

lib/structures/ServerMember.ts:229open in new window

Last Updated:
Contributors: Reinhardt