mirror of
https://github.com/dscalzi/HeliosLauncher.git
synced 2024-12-22 11:42:14 -08:00
Bug fixes for discord rich presence.. all appears to work now.
This commit is contained in:
parent
5afd9815a5
commit
45998a2239
@ -1,5 +1,5 @@
|
|||||||
// Work in progress
|
// Work in progress
|
||||||
const Client = require('discord-rpc')
|
const {Client} = require('discord-rpc')
|
||||||
const ConfigManager = require('./configmanager.js')
|
const ConfigManager = require('./configmanager.js')
|
||||||
|
|
||||||
let rpc
|
let rpc
|
||||||
@ -11,10 +11,10 @@ exports.initRPC = function(genSettings, servSettings){
|
|||||||
const activity = {
|
const activity = {
|
||||||
// state = top text
|
// state = top text
|
||||||
// details = bottom text
|
// details = bottom text
|
||||||
state: 'Server: ' + settings.shortId,
|
state: 'Server: ' + servSettings.shortId,
|
||||||
details: '',
|
details: 'Exploring the wall',
|
||||||
largeImageKey: servSettings.largeImageKey,
|
largeImageKey: servSettings.largeImageKey,
|
||||||
largeImageText: serSettings.largeImageText,
|
largeImageText: servSettings.largeImageText,
|
||||||
smallImageKey: genSettings.smallImageKey,
|
smallImageKey: genSettings.smallImageKey,
|
||||||
smallImageText: genSettings.smallImageText,
|
smallImageText: genSettings.smallImageText,
|
||||||
startTimestamp: new Date().getTime() / 1000,
|
startTimestamp: new Date().getTime() / 1000,
|
||||||
@ -24,11 +24,11 @@ exports.initRPC = function(genSettings, servSettings){
|
|||||||
rpc.setActivity(activity)
|
rpc.setActivity(activity)
|
||||||
})
|
})
|
||||||
|
|
||||||
rpc.login(genSettings.clientID()).catch(error => {
|
rpc.login(genSettings.clientID).catch(error => {
|
||||||
if(error.message.includes('ENOENT')) {
|
if(error.message.includes('ENOENT')) {
|
||||||
console.log('Unable to initialize Discord Rich Presence, no client detected.')
|
console.log('Unable to initialize Discord Rich Presence, no client detected.')
|
||||||
} else {
|
} else {
|
||||||
console.log('Unable to initialize Discord Rich Presence: ' + error.message)
|
console.log('Unable to initialize Discord Rich Presence: ' + error.message, error)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"version": "1.0",
|
"version": "1.0",
|
||||||
"discord": {
|
"discord": {
|
||||||
"clientID": 385581240906022916,
|
"clientID": "385581240906022916",
|
||||||
"smallImageText": "WesterosCraft",
|
"smallImageText": "WesterosCraft",
|
||||||
"smallImageKey": "seal-circle"
|
"smallImageKey": "seal-circle"
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user