1.0.7 • Published 3 years ago

rpcord v1.0.7

Weekly downloads
10
License
MIT
Repository
github
Last release
3 years ago

RPCord

[NPM](https://npmjs.org/package/rpcord)

Module to interact with local Discord Client using IPC.

Features

  • All RPC Commands supported.
  • Simple interface.
  • Made with TypeScript.

Docs

Read the docs here.

Installation

You can install from NPM.

npm i rpcord

Example

const { RPClient, Presence } = require("rpcord");

const rpc = new RPClient("803507787497865226");

rpc.on("ready", () => {
  console.log("Connected!");
});

rpc.connect().then(() => {
  rpc.setActivity(
    new Presence()
      .setLargeImage("discord")
      .setDetails("Nothing")
      .setState("Idling")
      .setStartTimestamp(Date.now())
      .setPartyID("12345")
      .setPartySize(1, 2)
      .addButton({
        label: "RPCord Repo",
        url: "https://github.com/DjDeveloperr/RPCord",
      })
      .addButton({
        label: "RPCord NPM",
        url: "https://npmjs.org/package/rpcord",
      })
  );
});

Or an advanced one!

const { RPClient } = require("rpcord");

const rpc = new RPClient("client_id", {
  secret: "client_secret",
  scopes: ["rpc", "messages.read"],
});

rpc.on("ready", () => {
  console.log("Connected!");
});

rpc.on("messageCreate", console.log);

rpc.connect().then(() => {
  rpc.authorize().then(() => {
    rpc.subscribe("MESSAGE_CREATE", { channel_id: "channel_id" });
  });
});

Contributing

You're always welcome to contribute!

License

Check LICENSE for more info.

Copyright 2021 @ DjDeveloperr

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago