Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/antsif-a/riche
A powerful library for interacting with the Discord RPC
https://github.com/antsif-a/riche
api discord rpc typescript
Last synced: 1 day ago
JSON representation
A powerful library for interacting with the Discord RPC
- Host: GitHub
- URL: https://github.com/antsif-a/riche
- Owner: antsif-a
- License: apache-2.0
- Created: 2022-08-08T20:29:50.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-24T20:30:41.000Z (about 1 year ago)
- Last Synced: 2024-04-25T01:21:34.577Z (9 months ago)
- Topics: api, discord, rpc, typescript
- Language: TypeScript
- Homepage: https://npmjs.com/package/riche
- Size: 131 KB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-discord - riche - A powerful library for interacting with the Discord RPC. (Game SDK & RPC Bindings)
README
## About
**riche** [/ʀiʃ/] (fr. rich) is a powerful [Node.js](https://nodejs.org) module
that allows you to interact with Discord Rich Presence.- :hammer_and_wrench: Made with [TypeScript](https://www.typescriptlang.org/)
- :comet: Object-oriented
- :package: No dependencies
- :fire: Fast and secure## Installation
Use your favourite package manager to install riche:
```shell
# npm
npm install riche# yarn
yarn add riche# pnpm
pnpm add riche
```## Example usage
To use Rich Presence Discord requires for you to create a new [Discord application](https://discord.com/developers/applications).
After that navigate to `OAuth2` tab and copy `Client ID`.
Alternatively, you can use riche's internal id for testing: `1006301974075035679`.```javascript
const riche = require('riche');const activity = {
state: 'Signed in',
details: 'Using Discord',
timestamps: {
start: Date.now(),
},
assets: {
large_image: 'https://discord.com/assets/9f6f9cd156ce35e2d94c0e62e3eff462.png',
large_text: 'Discord',
},
};const client = riche.create('your-client-id');
client.connect()
.then(() => client.setActivity(activity))
.then(() => console.log('Activity has been set! Check your Discord profile'));
```See more examples [here](https://github.com/antsif-a/riche/tree/main/examples).