GithubHelp home page GithubHelp logo

cryptiklemur / discord-rpc Goto Github PK

View Code? Open in Web Editor NEW

This project forked from discordjs/rpc

0.0 2.0 0.0 1.36 MB

A simple RPC client for Discord somewhat stolen from the Discord StreamKit.

JavaScript 100.00%

discord-rpc's Introduction

Discord RPC Client

npm npm David

NPM

A simple RPC client for Discord somewhat stolen from the Discord StreamKit.

For the latest changes install via guscaplan/discord-rpc

This client is fully tested with browserify and webpack. It can also be used with regular node apps.

Webpack builds of the beautiful and ugly kind are in /webpack

// NODE
const RPCClient = require('discord-rpc').Client;
// BROWSER
const RPCClient = window.DiscordRPC.Client;

const client = new RPCClient({
  OAUTH2_CLIENT_ID: 'xyzxyzxyz'
});

client.evts.on('READY', () => {
  console.log('Authenticated!');
  console.log('User:' `${client.user.username}#${client.user.discriminator}`, client.user.id)
  console.log('Application:', client.application.name, client.application.id);
  client.request('GET_CHANNELS', {}, (err, data) => {
    // data.channels is an array of channels :)
  });

  // if you are so lucky as to have the rpc.api scope, you can have a little fun
  client.rest.sendMessage('some channel id', 'hello, how are you?');
});

client.connect(someAccessToken);

discord-rpc's People

Contributors

devsnek avatar

Watchers

James Cloos avatar Aaron Scherer avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.