New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

discord-rich-presence

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

discord-rich-presence - npm Package Compare versions

Comparing version 0.0.6 to 0.0.7

27

index.js

@@ -0,6 +1,9 @@

'use strict';
const Discord = require('discord-rpc');
const EventEmitter = require('events');
const browser = typeof window !== 'undefined';
function makeClient(id) {
function makeClient(clientId) {
const rpc = new Discord.Client({ transport: browser ? 'websocket' : 'ipc' });

@@ -13,6 +16,7 @@

updatePresence(d) {
if (connected)
if (connected) {
rpc.setActivity(d).catch((e) => this.emit('error', e));
else
} else {
activityCache = d;
}
}

@@ -29,2 +33,5 @@

rpc.closeJoinRequest(user).catch(handle);
break;
default:
throw new RangeError('unknown response');
}

@@ -36,12 +43,9 @@ }

}
};
}();
rpc.login(id)
rpc.login({ clientId })
.then(() => {
instance.emit('connected');
connected = true;
if (activityCache) {
rpc.setActivity(activityCache).catch((e) => instance.emit('error', e));
activityCache = null;
}
rpc.subscribe('ACTIVITY_JOIN', ({ secret }) => {

@@ -56,2 +60,7 @@ instance.emit('join', secret);

});
if (activityCache) {
rpc.setActivity(activityCache).catch((e) => instance.emit('error', e));
activityCache = null;
}
})

@@ -58,0 +67,0 @@ .catch((e) => instance.emit('error', e));

{
"name": "discord-rich-presence",
"version": "0.0.6",
"version": "0.0.7",
"description": "rich presence wrapper for discord-rpc",

@@ -29,3 +29,3 @@ "main": "index.js",

"dependencies": {
"discord-rpc": "^3.0.0-beta.8"
"discord-rpc": "github:discordjs/rpc"
},

@@ -32,0 +32,0 @@ "devDependencies": {

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc