VCollab.DiscordRichPresence 1.7.0

dotnet add package VCollab.DiscordRichPresence --version 1.7.0
                    
NuGet\Install-Package VCollab.DiscordRichPresence -Version 1.7.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="VCollab.DiscordRichPresence" Version="1.7.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="VCollab.DiscordRichPresence" Version="1.7.0" />
                    
Directory.Packages.props
<PackageReference Include="VCollab.DiscordRichPresence" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add VCollab.DiscordRichPresence --version 1.7.0
                    
#r "nuget: VCollab.DiscordRichPresence, 1.7.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package VCollab.DiscordRichPresence@1.7.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=VCollab.DiscordRichPresence&version=1.7.0
                    
Install as a Cake Addin
#tool nuget:?package=VCollab.DiscordRichPresence&version=1.7.0
                    
Install as a Cake Tool

<table frame="void"> <tr> <td width="200px"> <img src="https://raw.githubusercontent.com/Lachee/discord-rpc-csharp/master/Resources/logo.png" align="center" width="100%" /> </td> <td> <h1>Discord RPC C#</h1> <p> <a href="https://github.com/Lachee/discord-rpc-csharp/actions/workflows/release.yml"><img src="https://github.com/Lachee/discord-rpc-csharp/actions/workflows/release.yml/badge.svg" alt="Release 📦" /></a> <a href="https://app.codacy.com/gh/Lachee/discord-rpc-csharp/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade"><img src="https://app.codacy.com/project/badge/Grade/30c4e9f58b7f4a058f79ad0acd743edf" alt="Codacy Badge" /></a> <a href="https://www.nuget.org/packages/DiscordRichPresence/"><img src="https://img.shields.io/nuget/v/DiscordRichPresence.svg" alt="Nuget" /></a> <a href="https://github.com/Lachee/discord-rpc-csharp/tags"><img src="https://img.shields.io/github/package-json/v/lachee/discord-rpc-csharp?label=release" alt="GitHub package.json version" /></a> </p> <p> <strong>Discord RPC C#</strong> is a C# <em>implementation</em> of <a href="https://github.com/discordapp/discord-rpc">Discord RPC</a>. It enables integration of Discord Rich Presence into .NET applications without relying on the deprecated official C++ library. </p> <p> This project continues to receive updates and support, offering a managed and user-friendly way to add Rich Presence and related features into your apps without the need of the GameSDK. </p> </td> </tr> </table>

Key Features

Here are some key features of this library:

  • Full Rich Presence Implementation (including Join)
  • Events from Discord (such as presence update and join requests)
  • Error Handling & Error Checking with automatic reconnects
  • Well Documented (for all your IntelliSense needs)
  • Helper Functionality (eg: AvatarURL generator from Join Requests)
  • Managed Pipes
  • Ghost Prevention (Tells Discord to clear the RP on disposal)
  • Optionally Threaded Events (For when you just want the events to wait a moment)

Documentation

Extensive API documentation and usage articles can be found at lachee.github.io/discord-rpc-csharp/.

Supported .NET

This project supports the following .NET:

  • fx 4.5
  • core 3.1
  • net 7.0
  • net 8.0
  • net 9.0

Dependencies:

Quick Start

Check out the Getting Started for full guide on initialization, setting the presence, listening to events, and cleaning up.

Below is a very basic guide to get your first presence up.

dotnet add package DiscordRichPresence
using DiscordRPC;

public const string DISCORD_APP_ID = "424087019149328395";
public static DiscordRpcClient client;

public static void Main() 
{
	// Create the client and setup some basic events
	client = new DiscordRpcClient(DISCORD_APP_ID)
	{
		Logger = new Logging.ConsoleLogger(Logging.LogLevel.Info, true)
	};

	client.OnReady += (sender, e) =>
	{
		Console.WriteLine("Connected to discord with user {0}", msg.User.Username);
		Console.WriteLine("Avatar: {0}", msg.User.GetAvatarURL(User.AvatarFormat.WebP));
		Console.WriteLine("Decoration: {0}", msg.User.GetAvatarDecorationURL());
	};
	
	//Connect to the RPC
	client.Initialize();

	//Set the rich presence
	client.SetPresence(new RichPresence()
	{
		Details = "A Basic Example",
		State = "In Game",
		Assets = new Assets()
		{
			LargeImageKey = "image_large",
			LargeImageText = "Lachee's Discord IPC Library",
			SmallImageKey = "image_small"
		},
		Buttons = new Button[]
		{
			new Button() { Label = "lachee.dev", Url = "https://lachee.dev/" }
		}
	});	

	// ... Do Stuff ... 
	Console.ReadKey();

	// Cleanup
	client.Dispose();
}

Some platforms require specific tricks, gotchyas, and troubleshooting.

Check out the main documentation Getting Started to address these issues.

Code Example

The DiscordRPC.Example project contains a variety of examples to test and experiment with this library.

Use this project as a example on how to implement your own.

dotnet run --framework net9 --project DiscordRPC.Example --example=Basic

Building

Check out the building guide in the CONTRIBUTING.md

Tests

There are currently no tests available to validate the library. This is a active issue and need help with this. The test suite will likely need a way to mock the RPC client.

Contribution

All contributions are welcome and I am happy for any contribution. However, there are some things that will not be accepted:

  • Spelling only fixes (rude to only contribute to something copilot could do)
  • Complete or large rewrites (unwanted work load to review)
  • Dependency substitutions / removals / additions (these require a issue and discussion first)
  • Support for features only provided by custom Discord clients
  • Obviously AI additions

For more information, please read CONTRIBUTING.md

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net9.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.7.0 28 9/24/2025