riche
v1.1.0
Published
A powerful library for interacting with the Discord RPC
Downloads
11
Readme
About
riche [/ʀiʃ/] (fr. rich) is a powerful Node.js module that allows you to interact with Discord Rich Presence.
- :hammer_and_wrench: Made with TypeScript
- :comet: Object-oriented
- :package: No dependencies
- :fire: Fast and secure
Installation
Use your favourite package manager to install riche:
# 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.
After that navigate to OAuth2
tab and copy Client ID
.
Alternatively, you can use riche's internal id for testing: 1006301974075035679
.
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.