-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathautomatic-sessions.ts
More file actions
40 lines (38 loc) · 1001 Bytes
/
automatic-sessions.ts
File metadata and controls
40 lines (38 loc) · 1001 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import KeyvFile from "keyv-file";
import prompts from "prompts";
import { VRChat } from "vrchat";
const vrchat = new VRChat({
application: {
name: "Example",
version: "1.5.1",
contact: "[email protected]"
},
authentication: {
// optimistic: false,
credentials: () => prompts([
{
name: "username",
type: "text",
message: "VRChat username",
},
{
name: "password",
type: "password",
message: "VRChat password",
},
{
name: "twoFactorCode",
type: "text",
message: "Two-factor authentication code",
}
]),
},
keyv: new KeyvFile({ filename: "./data.json" }),
});
(async () => {
await vrchat.getCurrentSubscriptions({ throwOnError: true });
const { data: { displayName } } = await vrchat.getCurrentUser({ throwOnError: true });
// eslint-disable-next-line no-console
console.log(`Logged in as ${displayName}`);
// await Promise.all(Array.from({ length: 10 }).map(() => vrchat.getCurrentOnlineUsers({ throwOnError: true })));
})();