Presence

class Presence

Tracks a user’s current gateway presence in a guild. Presence data is cache-only and requires the privileged GUILD_PRESENCES gateway intent. It may be absent until Discord sends a presence update.

Properties

Property

Type

Description

activities

PresenceActivity[]

Current activities sent by Discord.

clientStatus

ClientStatus

Per-platform status sent by Discord.

guildId

string

Guild ID this presence belongs to.

raw

Record<string, unknown>

Raw Discord presence payload.

status

string

The user’s current status.

user

User | null

User object from the presence update, or null when only cached status is available.

userId

string

User ID this presence belongs to.

Methods

async Presence.fetchGuild() → Promise<Guild>

Fetch the guild for this presence.

async Presence.fetchMember() → Promise<GuildMember | null>

Fetch the guild member for this presence.

async Presence.fetchUser() → Promise<User>

Fetch the full user for this presence.

Presence.getCustomStatus() → PresenceActivity | null

Get the custom status activity, or null if not set.

Returns:

The custom status activity object, or null.

Presence.getPrimaryActivity() → PresenceActivity | null

Get the first non-custom activity, or null if none.

Returns:

The primary activity object, or null.

Presence.isDnd() → boolean

Returns whether this presence is currently set to do-not-disturb.

Returns:

Whether the check passed.

Presence.isIdle() → boolean

Returns whether this presence is currently idle.

Returns:

Whether the check passed.

Presence.isOffline() → boolean

Returns whether this presence is currently offline.

Returns:

Whether the check passed.

Presence.isOnline() → boolean

Returns whether this presence is currently online.

Returns:

Whether the check passed.