Compare commits

..

No commits in common. "354e60cb9266f2783fb8e9f69ae365690d15af57" and "4d554581cd549e017a743df5c05c0a8a9e758e7d" have entirely different histories.

3 changed files with 15 additions and 16 deletions

View File

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

19
package-lock.json generated
View File

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

View File

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