userinfo: anyMember null checks
This commit is contained in:
parent
a387eb9b2a
commit
111107eff2
1 changed files with 13 additions and 9 deletions
|
@ -245,11 +245,13 @@ userinfo.callback = async function (msg, line) {
|
||||||
|
|
||||||
if (anyMember) {
|
if (anyMember) {
|
||||||
const icons = [];
|
const icons = [];
|
||||||
for (const platform of Object.keys(anyMember.clientStatus)) {
|
if (anyMember.clientStatus) {
|
||||||
const status = anyMember.clientStatus[platform];
|
for (const platform of Object.keys(anyMember.clientStatus)) {
|
||||||
if (status == "offline") continue;
|
const status = anyMember.clientStatus[platform];
|
||||||
|
if (status == "offline") continue;
|
||||||
|
|
||||||
icons.push(Icons.presence[platform][status]);
|
icons.push(Icons.presence[platform][status]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
descLines.push("");
|
descLines.push("");
|
||||||
|
@ -259,11 +261,13 @@ userinfo.callback = async function (msg, line) {
|
||||||
descLines.push(Icons.offline.replace(":i:", ":Offline:"));
|
descLines.push(Icons.offline.replace(":i:", ":Offline:"));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const activity of anyMember.activities) {
|
if (anyMember.activities?.length > 0) {
|
||||||
if (activity.type == 4 || activity.type == 6) {
|
for (const activity of anyMember.activities) {
|
||||||
descLines.push(ActivityTypeNames[activity.type]);
|
if (activity.type == 4 || activity.type == 6) {
|
||||||
} else {
|
descLines.push(ActivityTypeNames[activity.type]);
|
||||||
descLines.push(`${ActivityTypeNames[activity.type]} **${activity.name}**`);
|
} else {
|
||||||
|
descLines.push(`${ActivityTypeNames[activity.type]} **${activity.name}**`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue