File tree Expand file tree Collapse file tree 4 files changed +82
-3
lines changed Expand file tree Collapse file tree 4 files changed +82
-3
lines changed Original file line number Diff line number Diff line change
1
+ export * from './users' ;
Original file line number Diff line number Diff line change
1
+ import type { APIConnection } from 'discord-api-types/v10' ;
2
+
3
+ /**
4
+ * Represents a user's connection on Discord.
5
+ */
6
+ export class Connection {
7
+ public constructor (
8
+ /**
9
+ * The raw data received from the API for the connection
10
+ */
11
+ protected raw : APIConnection ,
12
+ ) { }
13
+
14
+ /**
15
+ * The id of the connection account
16
+ */
17
+ public get id ( ) {
18
+ return this . raw . id ;
19
+ }
20
+
21
+ /**
22
+ * The username of the connection account
23
+ */
24
+ public get name ( ) {
25
+ return this . raw . name ;
26
+ }
27
+
28
+ /**
29
+ * The type of service this connection is for
30
+ */
31
+ public get type ( ) {
32
+ return this . raw . type ;
33
+ }
34
+
35
+ /**
36
+ * Whether the connection is revoked
37
+ */
38
+ public get revoked ( ) {
39
+ return this . raw . revoked ?? false ;
40
+ }
41
+
42
+ /**
43
+ * Any integrations associated with this connection
44
+ */
45
+ public get integrations ( ) {
46
+ return this . raw . integrations ?? null ;
47
+ }
48
+
49
+ /**
50
+ * Whether the connection is verified
51
+ */
52
+ public get verified ( ) {
53
+ return this . raw . verified ;
54
+ }
55
+
56
+ /**
57
+ * Whether friend sync is enabled for this connection
58
+ */
59
+ public get friendSync ( ) {
60
+ return this . raw . friend_sync ;
61
+ }
62
+
63
+ /**
64
+ * Whether activities related to this connection are shown in the users presence
65
+ */
66
+ public get showActivity ( ) {
67
+ return this . raw . show_activity ;
68
+ }
69
+
70
+ /**
71
+ * The visibilty state for this connection
72
+ */
73
+ public get visibility ( ) {
74
+ return this . raw . visibility ;
75
+ }
76
+ }
Original file line number Diff line number Diff line change @@ -44,14 +44,14 @@ export class User {
44
44
* Whether or not the user is a bot
45
45
*/
46
46
public get bot ( ) {
47
- return Boolean ( this . raw . bot ) ;
47
+ return this . raw . bot ?? false ;
48
48
}
49
49
50
50
/**
51
51
* Whether the user is an Official Discord System user
52
52
*/
53
53
public get system ( ) {
54
- return Boolean ( this . raw . system ) ;
54
+ return this . raw . system ?? false ;
55
55
}
56
56
57
57
/**
@@ -79,7 +79,7 @@ export class User {
79
79
}
80
80
81
81
/**
82
- * Whether the user has mfa enabled
82
+ * The user's primary discord language
83
83
* <info>This property is only set when the user was fetched with an Oauth2 token and the `identify` scope</info>
84
84
*/
85
85
public get locale ( ) {
Original file line number Diff line number Diff line change
1
+ export * from './Connection' ;
2
+ export * from './User' ;
You can’t perform that action at this time.
0 commit comments