Skip to content

Instantly share code, notes, and snippets.

@nea89o
Created September 23, 2018 18:42
Show Gist options
  • Save nea89o/c7fd5fcee8861b138770ec9a5613ce88 to your computer and use it in GitHub Desktop.
Save nea89o/c7fd5fcee8861b138770ec9a5613ce88 to your computer and use it in GitHub Desktop.
import { Client as RPCClient } from 'discord-rpc';
const client = new RPCClient({ transport: 'ipc' });
const scopes = ['rpc', 'rpc.api', 'messages.read'];
const clientId = '312256871174111233';
client.on('ready', () => {
console.log('Logged in as', client.application.name);
console.log('Authed for user', client.user.username);
// client.selectVoiceChannel('493422153002254337');
});
client.on('error', console.error)
client.login({ clientId, scopes }).catch(console.error);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment