https://github.com/foxt/easy-presence
Discord rich presence, batteries included!
https://github.com/foxt/easy-presence
discord discord-ipc discord-rich-presence discord-rpc-client
Last synced: 21 days ago
JSON representation
Discord rich presence, batteries included!
- Host: GitHub
- URL: https://github.com/foxt/easy-presence
- Owner: foxt
- Created: 2021-08-21T11:54:19.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-11-15T17:46:08.000Z (over 2 years ago)
- Last Synced: 2025-04-19T01:32:58.846Z (about 1 month ago)
- Topics: discord, discord-ipc, discord-rich-presence, discord-rpc-client
- Language: TypeScript
- Homepage: http://npmjs.com/package/easy-presence
- Size: 75.2 KB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# EasyPresence
Discord Rich Presence, made easy!
## Why EasyPresence?
- Reliable
- EasyPresence was built with one purpose, rich presence, batteries included. Thanks to this, a lot of code (such as automatic reconnection, ratelimiting) is built directly in.
- Simple
- You only have to add 1 line of code to your project to get working rich presence. It's really that simple.
- Light
- EasyPresence has **0** dependencies, and is only 30kb (less than 40% of `discord-rpc`).
- Typed
- EasyPresence is written in pure TypeScript, and therefore has typings straight out of the box.## Example
### One-liner
```js
(new (require("easy-presence").EasyPresence)("878603502048411648")).setActivity({
details: "Using EasyPresence",
state: "neato!",
});
```
### Advanced
```js
const client = new (require("easy-presence").EasyPresence)("878603502048411648"); // replace this with your Discord Client ID.
client.on("connected", () => {
console.log("Hello,", client.environment.user.username);
});// This will be logged when the presence was sucessfully updated on Discord.
client.on("activityUpdate", (activity) => {
console.log("Now you're playing", activity ? activity.name : "nothing!")
});setInterval(() => {
client.setActivity({
details: "Using EasyPresence",
state: "neato!",
assets: {
large_image: "rblxrp",
large_text: "EasyPresence",
small_image: "octocat",
small_text: "https://github.com/rblxrp/easypresence"
},
buttons: [
{
label: "Visit on GitHub",
url: "https://github.com/rblxrp/easypresence"
}
],
party: {
id: "1234567890",
size: [1, 10]
},
timestamps: { start: new Date() }
});
// Remove the presence
//client.setActivity();
}, 1000);
```