-
-
Notifications
You must be signed in to change notification settings - Fork 48
/
presence.ts
84 lines (74 loc) · 1.55 KB
/
presence.ts
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
export interface ClientStatus {
desktop?: StatusType
mobile?: StatusType
web?: StatusType
}
export interface ActivityPayload {
name: string
type: 0 | 1 | 2 | 3 | 4 | 5
url?: string | undefined
created_at: number
timestamps?: ActivityTimestamps
application_id?: string
details?: string | undefined
state?: string | undefined
emoji?: ActivityEmoji
party?: ActivityParty
assets?: ActivityAssets
secrets?: ActivitySecrets
instance?: boolean
flags?: number
}
export interface ActivityTimestamps {
start?: number
end?: number
}
export interface ActivityEmoji {
name: string
id?: string
animated?: boolean
}
export interface ActivityParty {
id?: string
size?: number[]
}
export interface ActivityAssets {
large_image?: string
large_text?: string
small_image?: string
small_text?: string
}
export interface ActivitySecrets {
join?: string
spectate?: string
match?: string
}
export enum ActivityFlags {
INSTANCE = 1 << 0,
JOIN = 1 << 1,
SPECTATE = 1 << 2,
JOIN_REQUEST = 1 << 3,
SYNC = 1 << 4,
PLAY = 1 << 5
}
export type ActivityType =
| 'PLAYING'
| 'STREAMING'
| 'LISTENING'
| 'WATCHING'
| 'CUSTOM_STATUS'
| 'COMPETING'
export type StatusType = 'online' | 'invisible' | 'offline' | 'idle' | 'dnd'
export interface ActivityGame {
name: string
type: 0 | 1 | 2 | 3 | 4 | 5 | ActivityType
url?: string
/** Used for CUSTOM_STATUS */
state?: string
}
export interface ClientActivity {
status?: StatusType
activity?: ActivityGame | ActivityGame[]
since?: number | null
afk?: boolean
}