discord-rpc/README.md
Naomi Carrigan 4911c87ee9
All checks were successful
Node.js CI / Lint and Test (push) Successful in 32s
docs: update readme
2025-02-18 16:11:03 -08:00

6.8 KiB

Naomi's Discord Rich Presence

This is a linux binary which allows you to display a custom rich presence on Discord.

Prerequisites

You will need a Discord application. You can set one up in their Developer Portal. Note that the name of your application will be exposed in your status while you're running this app. For example, I named my app "on her computer":

Naomi's discord account in the member list, showing "playing on her computer" as the status

You will also need to upload at least one asset for the application's rich presence. You can do so by selecting Rich Presence -> Art Assets in the developer portal for your application, and uploading Rich Presence Assets:

A Discord developer portal interface showing the Rich Presence Art Assets section. The page displays settings for configuring game integration with Discord, including a cover image upload area and an IRL invite image example. The main content shows two existing assets labeled "primary" and "secondary" with small thumbnail icons. There's an "Add Image(s)" button with specifications for .png, .jpg, or .jpeg files at 1024x1024 recommended size. A warning message about asset key caching is displayed in a gold-colored box. The left sidebar contains various navigation options including General Information, Installation, OAuth2, Bot, and other development tools. The interface is predominantly dark-themed with white and blue text.

Installation

There are two binaries to install. The primary binary is naomis-drpc and is REQUIRED. The naomis-drpc-setup is an OPTIONAL binary which contains the configuration wizard.

Download the binaries you would like, then use chmod +x /path/to/download to make them executable. Copy them to /usr/bin to make them available in your system.

Configuration

The configuration file is stored in and loaded from $HOME/.config/naomis-drpc/config.json. There are two ways you can modify your config:

Setup Wizard

If you have installed naomis-drpc-setup, you can run it to configure your presence via our interactive wizard:

Welcome to the Discord Rich Presence Setup Wizard!
Before you get started, you need to create a Discord application on their developer portal. https://discord.dev
Enter your Discord application ID. You can obtain this from the Discord Developer Portal:1341504343693721720
Enter the first line of text you'd like to show in your presence:She's probably working.
Enter the second line of text you'd like to show in your presence:Who knows? Not us.
The next section sets up the images to display in your presence. You can upload these images to your application under Rich Presence -> Art Assets.
Enter the DISCORD name of the image you uploaded to display as the large image:primary
Enter the text to display when hovering over the large image:NHCarrigan
Enter the DISCORD name of the image you uploaded to display as the small image:secondary
Enter the text to display when hovering over the small image:NaomiLGBT
You can optionally display buttons that other users can click on in your presence.
Do you want to display buttons in your presence? (y/N) y
Enter the text to display on the first button:Join our community!
Enter the URL to open when the first button is clicked:https://chat.nhcarrigan.com
Enter the text to display on the second button:Donate? 🥺
Enter the URL to open when the second button is clicked:https://docs.nhcarrigan.com/about/donate/
Config file written successfully! You can now run naomis-drpc to start your Discord Rich Presence.

Manual Editing

Advanced users may choose to edit the config.json file manually. CAUTION: Doing so requires knowledge of JSON formatting. If you break the formatting, the application will error.

Configuration Keys

  • appId: This is the application ID for the app you would like to connect to.
  • details: This is the first line of text that appears within your presence.
  • state: This is the second line of text that appears within your presence.
  • largeImageKey: The name of the image uploaded to your Discord app that you would like shown as the larger presence image.
  • largeImageText: The text displayed when a user hovers over the large image.
  • smallImageKey: The name of the image uploaded to your Discord app that you would like shown as the smaller presence image.
  • smallImageText: The text displayed when a user hovers over the small image.
  • buttonOneLabel: The text for the first button.
  • buttonOneUrl: The link that should open when a user clicks the first button.
  • buttonTwoLabel: The text for the second button.
  • buttonTwoUrl: The link that should open when a user clicks the second button.

Note that buttons are optional, and you can omit those properties if you prefer not to have buttons.

Many of these keys will correspond to this layout:

A diagram showing the layout of a Discord-style interface with labeled elements. The image includes annotations pointing to different components. "Large Image" points to the main display area. "Small Image" indicates a smaller icon or avatar area. "Button 1" labels a button that says "Join our community!". "Button 2" labels a button showing "Donate? 🤔". "App name" points to the header area. "Details" indicates descriptive text reading "She's hard at work!". "State" points to status text showing "Or is she slacking off...?" The interface shows a "Playing" status with a timestamp of 4:36. The layout uses a dark theme with teal/blue accent colors.

Example

Here is an example of a proper configuration object:

{
    "appId": "1341504343693721720",
    "details": "She's hard at work!",
    "state": "Or is she slacking off...?",
    "largeImageKey": "primary",
    "largeImageText": "NHCarrigan",
    "smallImageKey": "secondary",
    "smallImageText": "NaomiLGBT",
    "buttonOneLabel": "Join our community!",
    "buttonOneUrl": "https://chat.nhcarrigan.com",
    "buttonTwoLabel": "Donate? 🥺",
    "buttonTwoUrl": "https://docs.nhcarrigan.com/about/donate/"
}

Feedback and Bugs

If you have feedback or a bug report, please feel free to open an issue!

Contributing

If you would like to contribute to the project, you may create a Pull Request containing your proposed changes and we will review it as soon as we are able! Please review our contributing guidelines first.

Code of Conduct

Before interacting with our community, please read our Code of Conduct.

License

This software is licensed under our global software license.

Copyright held by Naomi Carrigan.

Contact

We may be contacted through our Chat Server or via email at contact@nhcarrigan.com. -->