Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions rp-app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules/
dist/
.DS_Store
*.log
88 changes: 88 additions & 0 deletions rp-app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Discord Rich Presence Controller

A simple Electron app to set custom Discord Rich Presence status.

## Setup

1. Install dependencies:
```bash
npm install
```

2. Run the app:
```bash
npm start
```

## Usage

1. **Get a Discord Application ID**:
- Go to [Discord Developer Portal](https://discord.com/developers/applications)
- Create a new application (or use an existing one)
- Copy the "Application ID" from the General Information page

2. **Set up Rich Presence Assets** (optional):
- In your Discord application, go to "Rich Presence" → "Art Assets"
- Upload images you want to use for large/small icons
- Note the asset names for use in the app

3. **Connect and Customize**:
- Paste your Application ID in the app
- Click "Connect"
- Fill in the fields you want to display
- Click "Update Presence"

## Fields

| Field | Description | Max Length |
|-------|-------------|------------|
| Details | First line of text | 128 chars |
| State | Second line of text | 128 chars |
| Large Image | Asset name or image URL | - |
| Large Image Text | Hover text for large image | 128 chars |
| Small Image | Asset name or image URL | - |
| Small Image Text | Hover text for small image | 128 chars |
| Button 1/2 Label | Button text | 32 chars |
| Button 1/2 URL | Button link | Valid URL |

## Activity Types

- **Playing** - "Playing {details}"
- **Streaming** - "Streaming {details}"
- **Listening** - "Listening to {details}"
- **Watching** - "Watching {details}"
- **Competing** - "Competing in {details}"

## Timestamps

- **Elapsed**: Shows "XX:XX elapsed"
- **Remaining**: Shows "XX:XX left" (requires duration)

## Notes

- Discord must be running for Rich Presence to work
- Buttons are only visible to other users (not yourself)
- Image URLs must be publicly accessible HTTPS URLs
- Changes may take a few seconds to appear in Discord

## Architecture

This app follows the same Discord RPC implementation pattern as [YouTube Music Desktop](https://github.com/pear-devs/pear-desktop):

```
src/
├── main/
│ ├── index.js # Electron main process
│ ├── discord-service.js # Discord RPC service
│ ├── timer-manager.js # Timer management
│ └── constants.js # Constants
├── renderer/
│ ├── index.html # UI
│ ├── styles.css # Styles
│ └── renderer.js # UI logic
└── preload.js # IPC bridge
```

## License

MIT
18 changes: 18 additions & 0 deletions rp-app/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "rp",
"version": "1.0.0",
"description": "Custom Discord Rich Presence Controller",
"main": "src/main/index.js",
"scripts": {
"start": "electron .",
"dev": "electron ."
},
"author": "",
"license": "MIT",
"devDependencies": {
"electron": "^33.0.0"
},
"dependencies": {
"@xhayper/discord-rpc": "^1.3.0"
}
}
8 changes: 8 additions & 0 deletions rp-app/src/main/constants.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* Enum for keys used in TimerManager.
*/
const TimerKey = {
DiscordConnectRetry: 'discordConnectRetry',
};

module.exports = { TimerKey };
Loading