Class
ClientUser
The logged-in bot/user (`client.user`).
Extends User
Constructor
new ClientUser
()Properties
client
: Client (readonly)Methods
bulkDeleteMyMessagesInGuild
(guildId: string, options?: SudoVerificationOptions): Promise<void>Delete every message authored by the caller across a guild (sudo).
| Param | Type | Description |
|---|---|---|
| guildId | string | |
| options? | SudoVerificationOptions |
fetch
(): Promise<this>GET /users/@me — refresh the logged-in user from REST and patch this instance.
fetchGuilds
(options?: { withCounts?: boolean; }): Promise<PartialUserGuildPayload[]>GET /users/@me/guilds — returns camelCase partial guilds.
| Param | Type | Description |
|---|---|---|
| options? | { withCounts?: boolean; } |
leaveGuild
(guildId: string, options?: SudoVerificationOptions): Promise<void>DELETE /users/@me/guilds/{guild_id}
| Param | Type | Description |
|---|---|---|
| guildId | string | |
| options? | SudoVerificationOptions |
setPresence
(presence: PresenceUpdateOptions): voidBroadcast presence (gateway opcode 3) on all shards.
| Param | Type | Description |
|---|---|---|
| presence | PresenceUpdateOptions |