Beginning work on configuration management, updates to UI to prevent unresponsive behavior, bug fixes..

This commit is contained in:
Daniel Scalzi
2017-11-30 01:40:56 -05:00
parent aac789bf2c
commit 4c2c46f535
12 changed files with 482 additions and 198 deletions

View File

@@ -0,0 +1,22 @@
// Work in progress
const Client = require('discord-rpc')
const {DEFAULT_CONFIG} = require('./constants')
let rpc
function initRPC(){
rpc = new Client({ transport: 'ipc' });
rpc.login(DEFAULT_CONFIG.getDiscordClientID()).catch(error => {
if(error.message.includes('ENOENT')) {
console.log('Unable to initialize Discord Rich Presence, no client detected.')
} else {
console.log('Unable to initialize Discord Rich Presence: ' + error.message)
}
})
}
function shutdownRPC(){
rpc.destroy()
rpc = null
}