Seperate custom status from other actiiviity types
This commit is contained in:
parent
82cf202b76
commit
7537fd8bf6
1 changed files with 19 additions and 0 deletions
19
index.js
19
index.js
|
@ -106,6 +106,25 @@ function socketeer() {
|
|||
} else if (data.op == 0) {
|
||||
lanyardData = data
|
||||
lanyardData.d.socials = JSON.parse(fs.readFileSync(path.join(configPath, "socials.json")))
|
||||
|
||||
var newArr = []
|
||||
for (var i = 0; i < lanyardData.d.activities.length; i++) {
|
||||
var activity = lanyardData.d.activities[i]
|
||||
|
||||
if (activity.type != 4) {
|
||||
newArr.push(activity)
|
||||
} else if (activity.type == 4) {
|
||||
lanyardData.d.custom_status = {
|
||||
"text": activity.state
|
||||
}
|
||||
if (activity.emoji) {
|
||||
lanyardData.d.custom_status.emoji = activity.emoji
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lanyardData.d.activities = newArr
|
||||
|
||||
if (lanyardData.d.discord_status == "offline") {
|
||||
lanyardData.d.activityChanged = false
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue