Skip to content

RichPresence ​

classe · Source

Constructor ​

new RichPresence(client: Client, data?: RichPresence)

Parameters

NameTypeDescription
clientClientDiscord client
data?RichPresenceRichPresence to clone or raw data Default: {}.

Methods ​

setup ​

private

setup(data: RichPresence)

Sets the status from a JSON object Parameters

NameTypeDescription
dataRichPresencedata
Source

setAssetsLargeImage ​

setAssetsLargeImage(image: RichPresenceImage): RichPresence

Set the large image of this activity Parameters

NameTypeDescription
imageRichPresenceImageThe large image asset's id

Returns: RichPresenceSource

setAssetsSmallImage ​

setAssetsSmallImage(image: RichPresenceImage): RichPresence

Set the small image of this activity Parameters

NameTypeDescription
imageRichPresenceImageThe small image asset's id

Returns: RichPresenceSource

setAssetsLargeText ​

setAssetsLargeText(text: string): RichPresence

Hover text for the large image Parameters

NameTypeDescription
textstringAssets text

Returns: RichPresenceSource

setAssetsSmallText ​

setAssetsSmallText(text: string): RichPresence

Hover text for the small image Parameters

NameTypeDescription
textstringAssets text

Returns: RichPresenceSource

setName ​

setName(name: string): RichPresence

Set the name of the activity Parameters

NameTypeDescription
namestringThe activity's name

Returns: RichPresenceSource

setURL ​

setURL(url: string): RichPresence

If the activity is being streamed, a link to the stream Parameters

NameTypeDescription
urlstringURL of the stream

Returns: RichPresenceSource

setType ​

setType(type: ActivityTypes): RichPresence

The activity status's type Parameters

NameTypeDescription
typeActivityTypesThe type of activity

Returns: RichPresenceSource

setApplicationId ​

setApplicationId(id: Snowflake): RichPresence

Set the application id of this activity Parameters

NameTypeDescription
idSnowflakeBot's id

Returns: RichPresenceSource

setState ​

setState(state: string): RichPresence

Set the state of the activity Parameters

NameTypeDescription
statestringThe state of the activity

Returns: RichPresenceSource

setDetails ​

setDetails(details: string): RichPresence

Set the details of the activity Parameters

NameTypeDescription
detailsstringThe details of the activity

Returns: RichPresenceSource

setParty ​

setParty(party: RichParty): RichPresence

Set the party of this activity Parameters

NameTypeDescription
partyRichPartyThe party to be displayed

Returns: RichPresenceSource

setStartTimestamp ​

setStartTimestamp(timestamp: Date | number | null): RichPresence

Sets the start timestamp of the activity Parameters

NameTypeDescription
timestampDate | number | nullThe timestamp of the start of the activity

Returns: RichPresenceSource

setEndTimestamp ​

setEndTimestamp(timestamp: Date | number | null): RichPresence

Sets the end timestamp of the activity Parameters

NameTypeDescription
timestampDate | number | nullThe timestamp of the end of the activity

Returns: RichPresenceSource

setButtons ​

setButtons(button: RichButton): RichPresence

Set the buttons of the rich presence Parameters

NameTypeDescription
buttonRichButtonA list of buttons to set

Returns: RichPresenceSource

setPlatform ​

setPlatform(platform: ActivityPlatform | null): RichPresence

The platform the activity is being played on Parameters

NameTypeDescription
platformActivityPlatform | nullAny platform

Returns: RichPresenceSource

setJoinSecret ​

setJoinSecret(join: string): RichPresence

Secrets for rich presence joining and spectating (send-only) Parameters

NameTypeDescription
joinstringSecrets for rich presence joining

Returns: RichPresenceSource

addButton ​

addButton(name: string, url: string): RichPresence

Add a button to the rich presence Parameters

NameTypeDescription
namestringThe name of the button
urlstringThe url of the button

Returns: RichPresenceSource

toJSON ​

toJSON(): Object

Convert the rich presence to a JSON object Returns: ObjectSource

toString ​

toString(): string

When concatenated with a string, this automatically returns the activities' name instead of the Activity object. Returns: stringSource

getExternal ​

static · async

async getExternal(client: Client, applicationId: Snowflake, images: string): Promise<Array<ExternalAssets>>

Retrieves external assets from a RichPresence Parameters

NameTypeDescription
clientClientThe Discord client instance.
applicationIdSnowflakeThe application ID associated with the Rich Presence.
imagesstring1 or 2 external image URLs (not hosted by Discord).

Returns: Promise<Array<ExternalAssets>>Source

Unofficial software. Not affiliated with or supported by Discord.