bug fixes
This commit is contained in:
parent
605d0a2e5f
commit
52cc72f94c
1 changed files with 8 additions and 5 deletions
13
index.js
13
index.js
|
@ -39,7 +39,7 @@ function update() {
|
|||
"name": "nothing",
|
||||
"presence": "",
|
||||
"img": "",
|
||||
"pfp": html.substring(html.indexOf('<img src="https://avatars') + 10, html.indexOf("medium")) + "full.jpg",
|
||||
"pfp": "",
|
||||
"username": ""
|
||||
}
|
||||
|
||||
|
@ -64,6 +64,9 @@ function update() {
|
|||
if (html.includes("game_logo")) {
|
||||
var blah = html.substring(html.indexOf('game_logo" src="') + 'game_logo" src="'.length + 8, html.indexOf("capsule"))
|
||||
json.img = thumborURL + blah + "logo.png"
|
||||
|
||||
json.pfp = html.substring(html.indexOf('<img src="https://avatars') + 10, html.indexOf("medium")) + "full.jpg"
|
||||
|
||||
}
|
||||
|
||||
if (prevGame != json.name) {
|
||||
|
@ -76,15 +79,15 @@ function update() {
|
|||
state: json.presence,
|
||||
startTimestamp: startTime,
|
||||
largeImageText: json.name,
|
||||
largeImageKey: json.img,
|
||||
largeImageKey: json.img || null,
|
||||
smallImageText: json.username,
|
||||
smallImageKey: json.pfp,
|
||||
smallImageKey: json.pfp || null,
|
||||
});
|
||||
|
||||
if (json.gameName == "nothing") {
|
||||
updateTime = (process.env.UPDATE_TIME || 30) * 2.5
|
||||
updateTime = (process.env.UPDATE_TIME || 45) * 2.5
|
||||
} else {
|
||||
updateTime = (process.env.UPDATE_TIME || 30)
|
||||
updateTime = (process.env.UPDATE_TIME || 45)
|
||||
}
|
||||
})
|
||||
setTimeout(() => {
|
||||
|
|
Loading…
Reference in a new issue