Skip to content

SpotifyRPC

classe · SourceExtends: RichPresence

Constructor

new SpotifyRPC(client: Client, options?: SpotifyRPC)

Parameters

NameTypeDescription
clientClientDiscord Client
options?SpotifyRPCOptions for the Spotify RPC

Properties

metadata

metadata: SpotifyMetadata

Spotify metadata Source

Methods

setup

private

setup(options: SpotifyRPC)

Sets the status from a JSON object Parameters

NameTypeDescription
optionsSpotifyRPCdata
Source

setSongId

setSongId(id: string): SpotifyRPC

Set Spotify song id to sync with Parameters

NameTypeDescription
idstringSong id

Returns: SpotifyRPCSource

addArtistId

addArtistId(id: string): SpotifyRPC

Add the artist id Parameters

NameTypeDescription
idstringArtist id

Returns: SpotifyRPCSource

setArtistIds

setArtistIds(ids: string | Array<string>): SpotifyRPC

Set the artist ids Parameters

NameTypeDescription
idsstring | Array<string>Artist ids

Returns: SpotifyRPCSource

setAlbumId

setAlbumId(id: string): SpotifyRPC

Set the album id Parameters

NameTypeDescription
idstringAlbum id

Returns: SpotifyRPCSource

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

Unofficial software. Not affiliated with or supported by Discord.