Skip to content
M2O Scripting APIScripting reference
Global objectClient APIGenerated

Discord

const Discord: object

Defined in: client/api.d.ts:2569

Client-only Discord rich-presence composer exposed as the global Discord; setters stage values until update or setPresence publishes them.

clear(): boolean

Clears the published Discord activity and resets staged state.

boolean

True when dispatched; false when Discord is unavailable.

getUserId(): string

Returns the signed-in Discord user’s snowflake.

string

User ID string, or an empty string until available.

isAvailable(): boolean

Checks whether Discord is connected and can publish presence.

boolean

True when rich presence is initialized.

reset(): void

Resets staged activity fields without publishing a Discord update.

void

setAssets(assets): void

Stages multiple Discord image fields at once.

Asset keys and tooltips to merge into the staged activity.

string

string

string

string

void

setDetails(details): void

Stages the top presence line.

string

the top presence line.

void

setEndTimestamp(seconds): void

Stages the countdown Unix timestamp in seconds; zero clears it.

number

the countdown Unix timestamp in seconds; zero clears it.

void

setInstance(instance): void

Stages whether the activity represents an instanced session.

boolean

whether the activity represents an instanced session.

void

setJoinSecret(secret): void

Stages the opaque join secret that enables invitations.

string

the opaque join secret that enables invitations.

void

setLargeImage(assetKey): void

Stages the large image asset key.

string

the large image asset key.

void

setLargeText(text): void

Stages the large image tooltip.

string

the large image tooltip.

void

setMatchSecret(secret): void

Stages the opaque match secret.

string

the opaque match secret.

void

setName(name): void

Stages the activity name.

string

the activity name.

void

setParty(party): void

Stages multiple Discord party fields at once.

Party fields to merge into the staged activity.

string

"private" | "public" | number

[number, number]

void

setPartyId(id): void

Stages the party grouping identifier.

string

the party grouping identifier.

void

setPartyPrivacy(privacy): void

Stages the party join-privacy name or numeric enum value.

number | "private" | "public"

the party join-privacy name or numeric enum value.

void

setPartySize(current, max): void

Stages the party’s current and maximum size.

number

Current party member count.

number

Maximum party capacity.

void

setPresence(options): boolean

Merges a complete option batch into the staged activity and publishes it immediately.

Record<string, unknown>

Batch of supported activity, timestamp, asset, party, secret, instance, and platform fields.

boolean

True when the update was dispatched; false when Discord is unavailable.

setSecrets(secrets): void

Stages multiple Discord activity secrets at once.

Opaque secrets to merge into the staged activity.

string

string

string

void

setSmallImage(assetKey): void

Stages the small image asset key.

string

the small image asset key.

void

setSmallText(text): void

Stages the small image tooltip.

string

the small image tooltip.

void

setSpectateSecret(secret): void

Stages the opaque spectate secret.

string

the opaque spectate secret.

void

setStartTimestamp(seconds): void

Stages the elapsed-time Unix timestamp in seconds; zero clears it.

number

the elapsed-time Unix timestamp in seconds; zero clears it.

void

setState(state): void

Stages the bottom presence line.

string

the bottom presence line.

void

setSupportedPlatforms(flags): void

Stages the supported-platform bitmask: Desktop 1, Android 2, and iOS 4.

number

the supported-platform bitmask: Desktop 1, Android 2, and iOS 4.

void

setType(type): void

Stages the Discord activity verb or numeric enum value.

number | "playing" | "streaming" | "listening" | "watching"

the Discord activity verb or numeric enum value.

void

update(): boolean

Publishes the currently staged activity as one rate-limited Discord update.

boolean

True when dispatched; false when Discord is unavailable.