1.0.17 • Published 2 years ago

discord-auto-rpc v1.0.17

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

Discord Auto RPC

Extends the discord-rpc library to automatically reconnect on disconnect/error

Example

import { AutoClient } from "discord-auto-rpc";
// import * as DiscordRPC from "discord-auto-rpc"
// const AutoClient = DiscordRPC.AutoClient

const client = new AutoClient({ transport: "ipc" });

const setActivity = () => {
  client.setActivity({
    details: "Hello",
    state: ":)",
    startTimestamp: new Date(),
    buttons: [{ label: "Example", url: "https://example.com" }],
  });
};

client.once("ready", () => {
  setActivity();
  setInterval(setActivity, 15e3);
});

client.endlessLogin({ clientId: "797173289616801862" });

// client.endlessLogin() will keep retrying to login until it is successful (ex. wait until discord is open if its not)

// if you want to attempt to login once - client.login()
// client.login() is still able to reconnect

Note that the auto reconnecting feature is only present when using IPC as the transport

1.0.17

2 years ago

1.0.16

2 years ago

1.0.11

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

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