Giter Club home page Giter Club logo

easy-presence's Introduction

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

(new (require("easy-presence").EasyPresence)("878603502048411648")).setActivity({
        details: "Using EasyPresence",
        state: "neato!",
});

Advanced

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);

easy-presence's People

Contributors

foxt avatar tayiorrobinson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

easy-presence's Issues

This repo and npm don't match

This repo has the 1.0.0-fix1 version while npm has 1.2.0-oops1 version which seem to be pretty different. I was trying to debug a problem I've been running into and then realized the problem I'm having doesn't even exist in the 1.0.0 version here on github.

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.