Skip to main content

Class: ClientUser

Hierarchy

Constructors

constructor

new ClientUser(client, data)

Parameters

NameType
clientClient
dataAPIUser

Inherited from

User.constructor

Defined in

packages/libcord/src/structures/User.ts:62

Properties

avatar

avatar: null | string

hash of user avatar

Inherited from

User.avatar

Defined in

packages/libcord/src/structures/User.ts:20


bot

bot: boolean

if the user is a bot

Inherited from

User.bot

Defined in

packages/libcord/src/structures/User.ts:40


client

Readonly client: Client

Inherited from

User.client

Defined in

packages/libcord/src/structures/Base.ts:8


createAt

Readonly createAt: number

the date of the user account was created in timestamp

Inherited from

User.createAt

Defined in

packages/libcord/src/structures/User.ts:50


discriminator

discriminator: string

discriminator of the user

Inherited from

User.discriminator

Defined in

packages/libcord/src/structures/User.ts:30


id

id: string

the id of the user

Inherited from

User.id

Defined in

packages/libcord/src/structures/User.ts:15


publicFlags

publicFlags: number

user public's flags

Inherited from

User.publicFlags

Defined in

packages/libcord/src/structures/User.ts:55


system

system: boolean

if the user are a official discord system user

Inherited from

User.system

Defined in

packages/libcord/src/structures/User.ts:45


tag

tag: string

tag of the user (username#descriminator)

Inherited from

User.tag

Defined in

packages/libcord/src/structures/User.ts:35


username

username: string

username of the user

Inherited from

User.username

Defined in

packages/libcord/src/structures/User.ts:25

Accessors

presence

get presence(): null | Presence

get current presence of the bot

Returns

null | Presence

Defined in

packages/libcord/src/structures/ClientUser.ts:12

Methods

avatarURL

avatarURL(__namedParameters): string

get avatar URL

Parameters

NameType
__namedParametersImageUrlOptions

Returns

string

Inherited from

User.avatarURL

Defined in

packages/libcord/src/structures/User.ts:83


edit

edit(data): void

Parameters

NameType
dataObject
data.avatar?string
data.username?string

Returns

void

Defined in

packages/libcord/src/structures/ClientUser.ts:62


setActivity

setActivity(activity): void

update the activity of the ClientUser

Example

client.user.setActivity({
name: 'using libcord',
type: 'game'
});

Parameters

NameTypeDescription
activityActivitythe activity to set

Returns

void

Defined in

packages/libcord/src/structures/ClientUser.ts:57


setAvatar

setAvatar(avatar): void

Parameters

NameType
avatarstring

Returns

void

Defined in

packages/libcord/src/structures/ClientUser.ts:76


setPresence

setPresence(presence): void

update bot presence

Example

client.user.setPresence({
status: "dnd",
activity: {
type: "game",
name: "on libcord"
}
});

Parameters

NameTypeDescription
presencePresencea object of presence

Returns

void

Defined in

packages/libcord/src/structures/ClientUser.ts:30


setStatus

setStatus(status): void

update the status of the ClientUser

Example

client.user.setStatus('dnd');

Parameters

NameTypeDescription
statusPresenceStatusthe status to set

Returns

void

Defined in

packages/libcord/src/structures/ClientUser.ts:43


setUsername

setUsername(username): void

Parameters

NameType
usernamestring

Returns

void

Defined in

packages/libcord/src/structures/ClientUser.ts:72


toJSON

toJSON(space?): string

Parameters

NameTypeDefault value
spacenumber1

Returns

string

Inherited from

User.toJSON

Defined in

packages/libcord/src/structures/User.ts:97


toString

toString(): string

Returns

string

Inherited from

User.toString

Defined in

packages/libcord/src/structures/User.ts:93