Compare commits

..

2 Commits

Author SHA1 Message Date
354e60cb92 make short if too long 2025-09-12 22:26:12 -07:00
e3793ca216 commit 2025-09-12 22:08:22 -07:00
3 changed files with 16 additions and 15 deletions

View File

@ -103,6 +103,7 @@ async function check_friends() {
}
if (!last_online || went_online?.length || went_offline?.length) {
let total_len = online.reduce((sum, usr) => sum + usr.displayName.length + 2, 0), toolong = total_len > 280;
let priv = online.filter(user => user.location == "private");
let notpriv = online.filter(user => user.location != "private");
@ -112,14 +113,14 @@ async function check_friends() {
if (notpriv.length) {
text.addText("Online: ")
for (let u of notpriv) {
text.addLink(u.displayName, `https://vrchat.com/home/user/${u.id}`);
text.addLink(toolong ? u.displayName.slice(1) : u.displayName, `https://vrchat.com/home/user/${u.id}`);
text.addText(", ");
}
}
if (priv.length) {
text.addText("\n\nPrivate: ");
for (let u of priv) {
text.addLink(u.displayName, `https://vrchat.com/home/user/${u.id}`);
text.addLink(toolong ? u.displayName.slice(1) : u.displayName, `https://vrchat.com/home/user/${u.id}`);
text.addText(", ");
}
}
@ -138,6 +139,9 @@ while (true) {
await check_friends();
} catch (error) {
console.error(error.stack);
if (error.response) {
console.error(error.response.data);
}
}
await new Promise(r => setTimeout(r, 1000*60*5));
}

19
package-lock.json generated
View File

@ -7,8 +7,8 @@
"dependencies": {
"@skyware/bot": "^0.3.11",
"dotenv": "^16.5.0",
"tough-cookie-file-store": "^3.0.1",
"vrchat": "^1.19.1"
"tough-cookie-file-store": "^3.0.2",
"vrchat": "^1.19.4"
}
},
"node_modules/@atcute/bluesky": {
@ -108,7 +108,6 @@
"version": "0.3.11",
"resolved": "https://registry.npmjs.org/@skyware/bot/-/bot-0.3.11.tgz",
"integrity": "sha512-fG4uvD/3+ynlQPRHv6pz4kk+5fbDNJYTORbLXwmlwWAzJ7FSBkahG1NeK2M+hqIYBVqdzAI5QqcM17fwJXeZeQ==",
"license": "MPL-2.0",
"dependencies": {
"@atcute/bluesky": "^1.0.7",
"@atcute/bluesky-richtext-builder": "^1.0.1",
@ -336,10 +335,9 @@
}
},
"node_modules/tough-cookie-file-store": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/tough-cookie-file-store/-/tough-cookie-file-store-3.0.1.tgz",
"integrity": "sha512-xRLHFG0zY83tVeMZIG9J38BgQF3N+r/DjDkrnDka5V84NF6whj9E6cI4Lq5jndakec7pZ3jZ03m+RbGnbcyekg==",
"license": "MIT",
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/tough-cookie-file-store/-/tough-cookie-file-store-3.0.2.tgz",
"integrity": "sha512-5Ot63W/4ZwZYDlurFJBqGsC3YNQ6nShksAQZa9z16n7tyCINK+KGKuaShsRPikOtFIbIJGRnwq1zbF3OyV4gVg==",
"dependencies": {
"tough-cookie": "^5.0.0"
},
@ -379,10 +377,9 @@
}
},
"node_modules/vrchat": {
"version": "1.19.1",
"resolved": "https://registry.npmjs.org/vrchat/-/vrchat-1.19.1.tgz",
"integrity": "sha512-lV6nCpQpHH+O5SnrVq3b3sPThUw4jExXgrI8fAr3ZoWyLn4SUn1RRjUmVDaypSDmnxbJH6AOowIiq3O2RtHejw==",
"license": "MIT",
"version": "1.19.4",
"resolved": "https://registry.npmjs.org/vrchat/-/vrchat-1.19.4.tgz",
"integrity": "sha512-ALEvO5VodRDvKw4pvhLV7a/3bUuCv+sv4V1M1qHlYgcKNWTDdKkKpIleVUqW7CZ/+uGJQA0eHQwSImrQ7ew0kw==",
"dependencies": {
"@types/tough-cookie": "^4.0.1",
"axios": "^0.26.1",

View File

@ -2,8 +2,8 @@
"dependencies": {
"@skyware/bot": "^0.3.11",
"dotenv": "^16.5.0",
"tough-cookie-file-store": "^3.0.1",
"vrchat": "^1.19.1"
"tough-cookie-file-store": "^3.0.2",
"vrchat": "^1.19.4"
},
"type": "module"
}