{"id":28906839,"url":"https://github.com/casperjdev/go-rpc","last_synced_at":"2026-04-27T18:31:39.246Z","repository":{"id":299783420,"uuid":"1002640925","full_name":"casperjdev/go-rpc","owner":"casperjdev","description":"Discord Rich Presence client for Linux devices, written in Go","archived":false,"fork":false,"pushed_at":"2025-06-18T08:42:09.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-18T09:35:22.754Z","etag":null,"topics":["discord","discord-game-sdk","discord-rpc","discord-rpc-client","go","golang","ipc","rpc"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/casperjdev.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-15T22:23:12.000Z","updated_at":"2025-06-18T08:42:13.000Z","dependencies_parsed_at":"2025-06-18T09:47:19.281Z","dependency_job_id":null,"html_url":"https://github.com/casperjdev/go-rpc","commit_stats":null,"previous_names":["casperjdev/go-rpc"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/casperjdev/go-rpc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casperjdev%2Fgo-rpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casperjdev%2Fgo-rpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casperjdev%2Fgo-rpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casperjdev%2Fgo-rpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/casperjdev","download_url":"https://codeload.github.com/casperjdev/go-rpc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casperjdev%2Fgo-rpc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32349381,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T17:12:42.749Z","status":"ssl_error","status_checked_at":"2026-04-27T17:12:41.658Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["discord","discord-game-sdk","discord-rpc","discord-rpc-client","go","golang","ipc","rpc"],"created_at":"2025-06-21T15:10:03.429Z","updated_at":"2026-04-27T18:31:39.241Z","avatar_url":"https://github.com/casperjdev.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-rpc\n\nA lightweight, configurable Discord Rich Presence client written in Go.\n\n## Features\n\n- ✅ Fully configurable via `config.json`\n- ✅ Automatically refreshes presence at runtime\n- ✅ Custom data embedding via BASH scripts\n- ✅ No OAuth required\n\n---\n\n## Requirements\n\n- Go 1.18+\n- Discord desktop client (must be running)\n- Unix-based OS (for default IPC path)\n\n_Note: Windows support is not quite there yet, but it is planned._\n\n---\n\n## Installation\n\n### Building from source\n\n```bash\ngit clone https://github.com/casperjdev/go-rpc\ncd go-rpc\ngo build -o go-rpc .\n```\n\n---\n\n## Usage\n\n### 1. Setup\n\nCreate an application on the [Discord Developer Portal](https://discord.com/developers/applications)\n\nSave the application ID aswell as set the name of the application. This will be the name of the activity on Discord.\n\nAll of the images you will be using should also be saved there.\n\n### 2. Configuration\n\nCreate a `config.json` file in the same directory as the build output.\n\nThe schema is adjacent to the one used by Discord's Game SDK. Same constraints apply:\n\n```jsonc\n{\n\t\"credentials\": {\n\t\t\"application_id\": \"123456789012345678\" // Get from Discord Developer Portal\n\t},\n\t// the \"activity\" object follows the Discord Game SDK schema\n\t\"activity\": {\n\t\t\"state\": \"Watching memes\", // Optional (but recommended)\n\t\t\"details\": \"Browsing Reddit\", // Optional (but recommended)\n\t\t\"timestamps\": {\n\t\t\t\"start\": 1718454373, // Optional (epoch seconds)\n\t\t\t\"end\": 1718457973 // Optional (epoch seconds)\n\t\t},\n\t\t\"assets\": {\n\t\t\t\"large_image\": \"big_image_key\", // Optional (image key uploaded in Dev Portal)\n\t\t\t\"large_text\": \"Hover text for large image\", // Optional\n\t\t\t\"small_image\": \"small_image_key\", // Optional\n\t\t\t\"small_text\": \"Hover text for small image\" // Optional\n\t\t},\n\t\t\"party\": {\n\t\t\t\"id\": \"party123\", // Optional\n\t\t\t\"size\": [1, 5] // Optional (current size, max size)\n\t\t},\n\t\t\"secrets\": {\n\t\t\t\"match\": \"match123\", // Optional (for invites)\n\t\t\t\"join\": \"joinSecret123\", // Optional\n\t\t\t\"spectate\": \"spectateSecret123\" // Optional\n\t\t},\n\t\t\"buttons\": [\n\t\t\t{ \"label\": \"My Website\", \"url\": \"https://example.com\" },\n\t\t\t{ \"label\": \"Join Discord\", \"url\": \"https://discord.gg/abcdef\" }\n\t\t],\n\t\t\"instance\": true // Optional (always `true` for Rich Presence)\n\t},\n\t\"constants\": {\n\t\t\"static\": {\n\t\t\t\"{kernel}\": \"uname -sr\" // Either pass bash command\n\t\t},\n\t\t\"dynamic\": {\n\t\t\t\"{uptime}\": \"./scripts/uptime.sh\" // or path to runnable script\n\t\t}\n\t}\n}\n```\n\n### 3. Embedding custom data\n\n**Method 1:** Pass bash commands\n\n`\"{kernel}\": \"uname -sr\"`\n\n**Method 2:** Pass path to runnable script\n\n`./scripts/uptime.sh`\n\n**Static Constants** are fetched once during presence initialization and never again (data that never changes).\n\n**Dynamic Constants** are fetched whenever the presence updates (for things like time, etc.).\n\nNotes:\n\n- You can name keys however you want (reccomended to use curly braces)\n- Scripts _must_ be executable (`chmod +x`) and they need to output exactly one line to `stdout`\n- It is reccomended to not use performance intensive scripts as they may be re-ran on every presence update.\n\n---\n\n## Running\n\nRun the built executable with Discord open\n\n\u003e You need to be using the desktop client for Discord. Web Discord has no way to communicate through IPC.\n\n### Running inside of a systemd service\n\nIf you want to for example automatically run this app when discord launches on your device you might want to use a **systemd service**.\n\nDiscord runs per-user, not globally. So your service must run as the same user who is logged into the graphical session (the one running Discord).\n\nUse a user-level service, not a system-wide one.\n\n\u003e A reccomended setup is to have a service run a watcher script that launches the app based on Discord being active\n\u003e\n\u003e `.../.../watcher.sh`\n\u003e\n\u003e ```bash\n\u003e #!/bin/bash\n\u003e\n\u003e APP_NAME=\"go-rpc\"\n\u003e APP_CMD=\"path/to/app/go-rpc\"\n\u003e\n\u003e cleanup() {\n\u003e   echo \"Watcher stopped. Cleaning up...\"\n\u003e   pkill -x \"$APP_NAME\"\n\u003e   exit 0\n\u003e }\n\u003e\n\u003e trap cleanup EXIT INT TERM HUP\n\u003e\n\u003e while true; do\n\u003e     if pgrep -x Discord \u003e /dev/null; then\n\u003e         if ! pgrep -x \"$APP_NAME\" \u003e /dev/null; then\n\u003e             echo \"Starting Go app...\"\n\u003e             \"$APP_CMD\" \u0026\n\u003e         fi\n\u003e     else\n\u003e         if pgrep -x \"$APP_NAME\" \u003e /dev/null; then\n\u003e             echo \"Stopping Go app...\"\n\u003e             pkill -x \"$APP_NAME\"\n\u003e         fi\n\u003e     fi\n\u003e     sleep 2\n\u003e done\n\u003e ```\n\u003e\n\u003e `.../systemd/user/go-rpc.service`\n\u003e\n\u003e ```service\n\u003e [Unit]\n\u003e Description=Discord Go App Watcher\n\u003e After=graphical-session.target\n\u003e PartOf=graphical-session.target\n\u003e\n\u003e [Service]\n\u003e Type=simple\n\u003e WorkingDirectory=/path/to/watcher\n\u003e ExecStart=/path/to/watcher/watcher.sh\n\u003e Restart=on-failure\n\u003e KillMode=control-group\n\u003e TimeoutStopSec=5\n\u003e RemainAfterExit=no\n\u003e\n\u003e [Install]\n\u003e WantedBy=default.target\n\u003e ```\n\u003e\n\u003e Make sure the watcher is runnable: `chmod +x .../.../discord-watcher.sh`\n\n---\n\n## Editing the source code\n\nIf you wish to fine-tune certain things like update and heartbeat intervals, the code is up for grabs.\n\nTips:\n\n- Make sure to not crank up the update rate too high or else your client might get flagged and blocked.\n- if you prefer to write Go code instead of BASH code to write scripts for constants, you can do so by extending the `getConstants()` function in `constants.go` and the re-building your app\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcasperjdev%2Fgo-rpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcasperjdev%2Fgo-rpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcasperjdev%2Fgo-rpc/lists"}