Skip to content

antsif-a/riche

Repository files navigation

riche

version size eslint

About

riche [/ʀiʃ/] (fr. rich) is a powerful Node.js module that allows you to interact with Discord Rich Presence.

  • 🛠️ Made with TypeScript
  • ☄️ Object-oriented
  • 📦 No dependencies
  • 🔥 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.