Class RichPresence
- Namespace
- DiscordRPC
- Assembly
- DiscordRPC.dll
The Rich Presence structure that will be sent and received by Discord. Use this class to build your presence and update it appropriately.
public sealed class RichPresence : BaseRichPresence
- Inheritance
-
RichPresence
- Inherited Members
Properties
Buttons
The buttons to display in the presence.
Max of 2
[JsonProperty("buttons", NullValueHandling = NullValueHandling.Ignore)]
public Button[] Buttons { get; set; }
Property Value
- Button[]
Methods
Clone()
Clones the presence into a new instance. Used for thread safe writing and reading. This function will ignore properties if they are in a invalid state.
public RichPresence Clone()
Returns
HasButtons()
Does the Rich Presence have any buttons?
public bool HasButtons()
Returns
WithAssets(Assets)
Sets the assets of the Rich Presence. See also Assets.
public RichPresence WithAssets(Assets assets)
Parameters
assets
AssetsThe names of the images to use and the tooltips to give those images.
Returns
- RichPresence
The modified Rich Presence.
WithButtons(Button, Button)
Sets the Rich Presence's buttons.
public RichPresence WithButtons(Button topButton, Button bottomButton = null)
Parameters
topButton
ButtonThe top button to display
bottomButton
ButtonThe optional bottom button to display
Returns
- RichPresence
The modified Rich Presence.
WithDetails(string)
Sets the details of the Rich Presence. See also Details.
public RichPresence WithDetails(string details)
Parameters
details
stringWhat the user is currently doing.
Returns
- RichPresence
The modified Rich Presence.
WithDetailsUrl(string)
Sets the details URL of the Rich Presence. See also DetailsUrl.
public RichPresence WithDetailsUrl(string detailsUrl)
Parameters
detailsUrl
stringDetails URL when clicking on the details text.
Returns
- RichPresence
The modified Rich Presence.
WithParty(Party)
Sets the Rich Presence's party. See also Party.
public RichPresence WithParty(Party party)
Parameters
party
PartyThe party the player is currently in.
Returns
- RichPresence
The modified Rich Presence.
WithSecrets(Secrets)
Sets the Rich Presence's secrets. See also Secrets.
public RichPresence WithSecrets(Secrets secrets)
Parameters
secrets
SecretsThe secrets used for Joining.
Returns
- RichPresence
The modified Rich Presence.
WithState(string)
Sets the state of the Rich Presence. See also State.
public RichPresence WithState(string state)
Parameters
Returns
- RichPresence
The modified Rich Presence.
WithStateUrl(string)
Sets the state URL of the Rich Presence. See also StateUrl.
public RichPresence WithStateUrl(string stateUrl)
Parameters
stateUrl
stringState URL when clicking on the state text.
Returns
- RichPresence
The modified Rich Presence.
WithStatusDisplay(StatusDisplayType)
Sets the display type for the status. See also StatusDisplayType.
public RichPresence WithStatusDisplay(StatusDisplayType statusDisplay)
Parameters
statusDisplay
StatusDisplayType
Returns
- RichPresence
The modified Rich Presence.
WithTimestamps(Timestamps)
Sets the timestamp of the Rich Presence. See also Timestamps.
public RichPresence WithTimestamps(Timestamps timestamps)
Parameters
timestamps
TimestampsThe time elapsed / remaining time data.
Returns
- RichPresence
The modified Rich Presence.
WithType(ActivityType)
Sets the type of the Rich Presence. See also ActivityType.
public RichPresence WithType(ActivityType type)
Parameters
type
ActivityTypeThe status type
Returns
- RichPresence
The modified Rich Presence.
Operators
implicit operator bool(RichPresence)
Operator that converts a presence into a boolean for null checks.
public static implicit operator bool(RichPresence presesnce)
Parameters
presesnce
RichPresence