Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/benjammin4dayz/discord-presence-utils
Tools for managing Discord Rich Presence
https://github.com/benjammin4dayz/discord-presence-utils
class discord ipc remote-procedure-call rich-presence rpc
Last synced: about 2 months ago
JSON representation
Tools for managing Discord Rich Presence
- Host: GitHub
- URL: https://github.com/benjammin4dayz/discord-presence-utils
- Owner: benjammin4dayz
- License: other
- Created: 2024-01-23T06:29:27.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-02-07T08:50:32.000Z (11 months ago)
- Last Synced: 2024-02-07T16:37:59.212Z (11 months ago)
- Topics: class, discord, ipc, remote-procedure-call, rich-presence, rpc
- Language: JavaScript
- Homepage:
- Size: 24.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Discord Presence Utils
Discord Presence Utils is a collection of easy-to-use modules designed to facilitate the management of Discord Rich Presence from your Node application.
| Docs | Module | Description |
| ----------------------------------- | ------------- | --------------------------------------------------------------- |
| [\[ X \]](./doc/discord-rpc.md) | RPCClient | Simple Discord RPC for setting Rich Presence on Discord. |
| [\[ X \]](./doc/process-monitor.md) | ProcMon | Basic process monitor to detect when a game starts or stops. |
| [\[ X \]](./doc/card-generator.md) | cardGenerator | Create HTML to preview a given presence or display in your docs |## Usage
1. Install the package with your favorite package manager.
npm install git+https://github.com/benjammin4dayz/discord-presence-utils
> 💡 You may opt to install a specific release tag by adding `#v0.0.0` to the end of this link.
2. Use the provided modules.
```js
import { RPCClient, ProcMon } from "discord-rpc-utils";const rpc = new RPCClient();
const clientId = "1234567890";
const chrome = new ProcMon(["chrome"]);chrome.on("start", () => {
rpc.connect(clientId);
rpc.setActivity({
details: "Hello, world!",
state: "I have arrived!",
});
});chrome.on("stop", () => {
rpc.destroy();
});
```## Acknowledgements
This repository contains a substantial amount of code from [discordjs/RPC](https://github.com/discordjs/RPC) which is used under the MIT license.