Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/djdeveloperr/rpcord
Module to interact with Discord IPC.
https://github.com/djdeveloperr/rpcord
discord ipc rpc typescript
Last synced: 3 months ago
JSON representation
Module to interact with Discord IPC.
- Host: GitHub
- URL: https://github.com/djdeveloperr/rpcord
- Owner: DjDeveloperr
- License: mit
- Created: 2021-01-24T09:03:53.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-05-30T04:28:11.000Z (over 3 years ago)
- Last Synced: 2024-10-18T13:32:35.634Z (3 months ago)
- Topics: discord, ipc, rpc, typescript
- Language: TypeScript
- Homepage:
- Size: 164 KB
- Stars: 10
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# RPCord
![[NPM](https://npmjs.org/package/rpcord)](https://img.shields.io/npm/v/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](https://github.com/DjDeveloperr/RPCord/blob/gh-pages/modules.md).
## Installation
You can install from [NPM](https://npmjs.org/package/rpcord).
```
npm i rpcord
```## Example
```ts
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!
```ts
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" });
});
});
```## Note
For now, OAuth only works if you have at least one Redirect URI set in Developer Portal.
## Contributing
You're always welcome to contribute!
## License
Check [LICENSE](LICENSE) for more info.
Copyright 2021 @ DjDeveloperr