Table of Contents

Class BaseRichPresence

Namespace
DiscordRPC
Assembly
DiscordRPC.dll

The base rich presence structure

[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
[Serializable]
public class BaseRichPresence
Inheritance
BaseRichPresence
Derived
Inherited Members

Fields

_details

Inernal inner detail string

protected string _details

Field Value

string

_detailsUrl

Inernal inner detail URL string

protected string _detailsUrl

Field Value

string

_state

Inernal inner state string

protected string _state

Field Value

string

_stateUrl

Inernal inner state URL string

protected string _stateUrl

Field Value

string

Properties

Assets

The names of the images to use and the tooltips to give those images.

[JsonProperty("assets", NullValueHandling = NullValueHandling.Ignore)]
public Assets Assets { get; set; }

Property Value

Assets

Details

What the user is currently doing. For example, "Competitive - Total Mayhem".

Max 128 characters

[JsonProperty("details", NullValueHandling = NullValueHandling.Ignore)]
public string Details { get; set; }

Property Value

string

DetailsUrl

URL that is linked to when clicking on the details text in the activity card.

Max 256 characters

[JsonProperty("details_url", NullValueHandling = NullValueHandling.Ignore)]
public string DetailsUrl { get; set; }

Property Value

string

Party

The party the player is currently in. The ID must be set for this to be included in the RichPresence update.

[JsonProperty("party", NullValueHandling = NullValueHandling.Ignore)]
public Party Party { get; set; }

Property Value

Party

Secrets

The secrets used for Joining. Secrets are obfuscated data of your choosing. They could be match ids, player ids, lobby ids, etc. Make this object null if you do not wish too / unable too implement the Join / Request feature.

To keep security on the up and up, Discord requires that you properly hash/encode/encrypt/put-a-padlock-on-and-swallow-the-key-but-wait-then-how-would-you-open-it your secrets.

Visit the Rich Presence How-To for more information.

[JsonProperty("secrets", NullValueHandling = NullValueHandling.Ignore)]
public Secrets Secrets { get; set; }

Property Value

Secrets

State

The user's current Party status. For example, "Playing Solo" or "With Friends".

Max 128 characters

[JsonProperty("state", NullValueHandling = NullValueHandling.Ignore)]
public string State { get; set; }

Property Value

string

StateUrl

URL that is linked to when clicking on the details text in the activity card.

Max 256 characters

[JsonProperty("state_url", NullValueHandling = NullValueHandling.Ignore)]
public string StateUrl { get; set; }

Property Value

string

StatusDisplay

The display type for the status

[JsonProperty("status_display_type", NullValueHandling = NullValueHandling.Ignore)]
public StatusDisplayType StatusDisplay { get; set; }

Property Value

StatusDisplayType

Timestamps

The time elapsed / remaining time data.

[JsonProperty("timestamps", NullValueHandling = NullValueHandling.Ignore)]
public Timestamps Timestamps { get; set; }

Property Value

Timestamps

Type

The activity type

[JsonProperty("type", NullValueHandling = NullValueHandling.Ignore)]
public ActivityType Type { get; set; }

Property Value

ActivityType

Methods

HasAssets()

Does the Rich Presence have valid assets?

public bool HasAssets()

Returns

bool

HasParty()

Does the Rich Presence have a valid party?

public bool HasParty()

Returns

bool

HasSecrets()

Does the Rich Presence have valid secrets?

public bool HasSecrets()

Returns

bool

HasTimestamps()

Does the Rich Presence have valid timestamps?

public bool HasTimestamps()

Returns

bool

ToRichPresence()

Converts this BaseRichPresence to RichPresence

public RichPresence ToRichPresence()

Returns

RichPresence

Operators

implicit operator bool(BaseRichPresence)

Operator that converts a presence into a boolean for null checks.

public static implicit operator bool(BaseRichPresence presence)

Parameters

presence BaseRichPresence

Returns

bool