@t_bot-team/discord-rpc

4.0.6 • Public • Published

SoundRPC

Overview

SoundRPC is a fork of the popular discord-rpc package, tailored to assist internal projects with a focus on voice-related functions. By removing unwanted features, it reduces bloat and enhances performance.

Importing the Package

ES5

const rpc = require("@t_bot-team/discord-rpc");
const client = new rpc.Client({ transport: "ipc" });

ES6

import rpc from "@t_bot-team/discord-rpc";
const client = new rpc.Client({ transport: "ipc" });

Examples

Browser Example

const clientId = '287406016902594560';
const scopes = ['rpc', 'messages.read'];

const client = new rpc.Client({ transport: 'websocket' });

client.on('ready', () => {
  console.log('Logged in as', client.application.name);
  console.log('Authed for user', client.user.username);

  client.selectVoiceChannel('81384788862181376');
});

// Log in to RPC with client id
client.login({ clientId, scopes });

IPC Example

const clientId = '287406016902594560';
const scopes = ['rpc']; // For scopes, you will need to specify the clientSecret in the login options

const client = new rpc.Client({ transport: 'ipc' });

client.on('ready', () => {
  console.log('Logged in as', client.application.name);
  console.log('Authed for user', client.user.username);
});

// Log in to RPC with client id
client.login({ clientId, scopes });

Package Sidebar

Install

npm i @t_bot-team/discord-rpc

Weekly Downloads

0

Version

4.0.6

License

AGPL-3.0-only

Unpacked Size

60.5 kB

Total Files

10

Last publish

Collaborators

  • tehpig