WidgetMember.js
1.86 KB
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
'use strict';
const Base = require('./Base');
/**
* Represents a WidgetMember.
*/
class WidgetMember extends Base {
/**
* Activity sent in a {@link WidgetMember}.
* @typedef {Object} WidgetActivity
* @property {string} name The name of the activity
*/
constructor(client, data) {
super(client);
/**
* The id of the user. It's an arbitrary number.
* @type {string}
*/
this.id = data.id;
/**
* The username of the member.
* @type {string}
*/
this.username = data.username;
/**
* The discriminator of the member.
* @type {string}
*/
this.discriminator = data.discriminator;
/**
* The avatar of the member.
* @type {?string}
*/
this.avatar = data.avatar;
/**
* The status of the member.
* @type {PresenceStatus}
*/
this.status = data.status;
/**
* If the member is server deafened
* @type {?boolean}
*/
this.deaf = data.deaf ?? null;
/**
* If the member is server muted
* @type {?boolean}
*/
this.mute = data.mute ?? null;
/**
* If the member is self deafened
* @type {?boolean}
*/
this.selfDeaf = data.self_deaf ?? null;
/**
* If the member is self muted
* @type {?boolean}
*/
this.selfMute = data.self_mute ?? null;
/**
* If the member is suppressed
* @type {?boolean}
*/
this.suppress = data.suppress ?? null;
/**
* The id of the voice channel the member is in, if any
* @type {?Snowflake}
*/
this.channelId = data.channel_id ?? null;
/**
* The avatar URL of the member.
* @type {string}
*/
this.avatarURL = data.avatar_url;
/**
* The activity of the member.
* @type {?WidgetActivity}
*/
this.activity = data.activity ?? null;
}
}
module.exports = WidgetMember;