2.0.4 • Published 1 month ago

discord-rpc-revamp v2.0.4

Weekly downloads
-
License
MIT
Repository
-
Last release
1 month ago

Discord RPC Revamp

Note: This package is a revamp of @discordjs/rpc, because I felt like it didn't work very well - so I rewrote it.

The code is messy, but here are some useful tips:

  • The API is the same as in @discordjs/rpc, except login() is now connect() and does not take a client secret.
  • Calling subscribe() will subscribe the client instance to the event, to handle it use client.on('EVENT', function handler() {})
  • List of events, methods, general guide on RPC (outdated but mostly relevant): link

Example

let client = new (require('discord-rpc-revamp').Client)();
client.connect({ clientId: 'YOUR_CLIENT_ID_HERE' }).catch(console.error);

client.on('ready', _ => {
    client.setActivity({
        details: 'Discord Rich Presence',
        state: 'Hello there!',
        startTimestamp: Date.now()
    }).then(_ => console.log('set activity')).catch(console.error);

    client.subscribe('ACTIVITY_JOIN');
    client.subscribe('ACTIVITY_JOIN_REQUEST');

    client.on('ACTIVITY_JOIN', data => {
        console.log('ACTIVITY_JOIN', data);
    });
});

Enjoy!

2.0.4

1 month ago

2.0.3

7 months ago

2.0.2

7 months ago

2.0.1

7 months ago

2.0.0

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago