Class: ClientUser
Hierarchy
↳
ClientUser
Constructors
constructor
• new ClientUser(client, data)
Parameters
| Name | Type |
|---|---|
client | Client |
data | APIUser |
Inherited from
Defined in
packages/libcord/src/structures/User.ts:62
Properties
avatar
• avatar: null | string
hash of user avatar
Inherited from
Defined in
packages/libcord/src/structures/User.ts:20
bot
• bot: boolean
if the user is a bot
Inherited from
Defined in
packages/libcord/src/structures/User.ts:40
client
• Readonly client: Client
Inherited from
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
Defined in
packages/libcord/src/structures/User.ts:50
discriminator
• discriminator: string
discriminator of the user
Inherited from
Defined in
packages/libcord/src/structures/User.ts:30
id
• id: string
the id of the user
Inherited from
Defined in
packages/libcord/src/structures/User.ts:15
publicFlags
• publicFlags: number
user public's flags
Inherited from
Defined in
packages/libcord/src/structures/User.ts:55
system
• system: boolean
if the user are a official discord system user
Inherited from
Defined in
packages/libcord/src/structures/User.ts:45
tag
• tag: string
tag of the user (username#descriminator)
Inherited from
Defined in
packages/libcord/src/structures/User.ts:35
username
• username: string
username of the user
Inherited from
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
| Name | Type |
|---|---|
__namedParameters | ImageUrlOptions |
Returns
string
Inherited from
Defined in
packages/libcord/src/structures/User.ts:83
edit
▸ edit(data): void
Parameters
| Name | Type |
|---|---|
data | Object |
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
| Name | Type | Description |
|---|---|---|
activity | Activity | the activity to set |
Returns
void
Defined in
packages/libcord/src/structures/ClientUser.ts:57
setAvatar
▸ setAvatar(avatar): void
Parameters
| Name | Type |
|---|---|
avatar | string |
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
| Name | Type | Description |
|---|---|---|
presence | Presence | a 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
| Name | Type | Description |
|---|---|---|
status | PresenceStatus | the status to set |
Returns
void
Defined in
packages/libcord/src/structures/ClientUser.ts:43
setUsername
▸ setUsername(username): void
Parameters
| Name | Type |
|---|---|
username | string |
Returns
void
Defined in
packages/libcord/src/structures/ClientUser.ts:72
toJSON
▸ toJSON(space?): string
Parameters
| Name | Type | Default value |
|---|---|---|
space | number | 1 |
Returns
string
Inherited from
Defined in
packages/libcord/src/structures/User.ts:97
toString
▸ toString(): string
Returns
string