-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathUser.js
More file actions
193 lines (163 loc) · 5.6 KB
/
Copy pathUser.js
File metadata and controls
193 lines (163 loc) · 5.6 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
/**
* DoggoReportBot - User.js - User Class file to create User objects.
* Copyright (C) 2023 Croluy
*
* This program comes with ABSOLUTELY NO WARRANTY;
* This is free software, and you are welcome to redistribute it under certain conditions;
* See https://www.gnu.org/licenses/ for details.
*/
class User{
/**
* @class
* User's Class Constructor
*
* @param {string} id *Required* User ID.
* @param {string} firstName *Required* First Name of User.
* @param {bool} isBot [DEFAULT: false] Is User a bot?
* @param {string} lastName [DEFAULT: undefined] Last Name of User.
* @param {string} fullName [DEFAULT: firstName+lastName] Full Name of User.
* @param {string} username [DEFAULT: undefined] User's username.
* @param {string} lang [DEFAULT: EN] User's IETF Language Tag (device dependant).
* @param {int} timeZone [DEFAULT: 0] User's time zone relative to (UTC) Coordinated Universal Time.
* @param {bool} isPrivate [DEFAULT: false] Has the User restricted it's privacy forwarding settings?
* @param {bool} isSuperior [DEFAULT: false] Has the User permission to use superior admin commands?
* @param {bool} isAdmin [DEFAULT: false] Is User admin?
* @param {bool} isBan [DEFAULT: false] Is User banned?
* @param {bool} isActive [DEFAULT: true] Does User have active chat with BOT?
*/
constructor(id, firstName, isBot=false, lastName=undefined, fullName=firstName+' '+lastName, username=undefined, lang="EN", timeZone=0, isPrivate=false, isSuperior=false, isAdmin=false, isBan=false, isActive=true){
//User infos
this.id = id;
this.firstName = firstName;
this.isBot = isBot;
this.lastName = lastName;
this.fullName = fullName;
this.username = username;
this.lang = lang;
this.timeZone = timeZone;
this.isPrivate = isPrivate;
this.isSuperior = isSuperior;
//Chat infos
this.isAdmin=isAdmin;
this.isBan = isBan;
this.isActive = isActive;
}
/**
* @return {string} User ID.
*/
get get_id(){return this.id;}
/**
* @return {string} User's first name.
*/
get get_firstName(){return this.firstName;}
/**
* @return {bool} Is User a bot.
*/
get get_isBot(){return this.isBot;}
/**
* @return {string} User's last name.
*/
get get_lastName(){return this.lastName;}
/**
* @return {string} User's full name.
*/
get get_fullName(){return this.fullName;}
/**
* @return {string} User's username.
*/
get get_username(){return this.username;}
/**
* @return {string} User's IETF Language Tag (device dependant).
*/
get get_lang(){return this.lang;}
/**
* @return {int} User's time zone UTC
*/
get get_timeZone(){return this.timeZone;}
/**
* @return {bool} Has the User restricted it's privacy forwarding settings?
*/
get get_isPrivate(){return this.isPrivate;}
/**
* @return {bool} Can user use superior admin commands?
*/
get get_isSuperior(){return this.isSuperior;}
/**
* @return {bool} Is User admin?
*/
get get_isAdmin(){return this.isAdmin;}
/**
* @return {bool} Is User banned?
*/
get get_isBan(){return this.isBan;}
/**
* @return {bool} Does User have active chat with BOT?
*/
get get_isActive(){return this.isActive;}
/**
*
* @param {string} *Required* User ID.
*/
set set_id(id){this.id = id;}
/**
*
* @param {string} *Required* First name of User.
*/
set set_firstName(firstName){this.firstName = firstName;}
/**
*
* @param {bool} [DEFAULT = false] Is User a bot?
*/
set set_isBot(isBot){this.isBot = isBot;}
/**
*
* @param {string} [DEFAULT = undefined] Last Name of User.
*/
set set_lastName(lastName){this.lastName = lastName;}
/**
*
* @param {string} [DEFAULT = undefined] Full Name of User.
*/
set set_fullName(fullName){this.fullName = fullName;}
/**
*
* @param {string} [DEFAULT = undefined] User's username.
*/
set set_username(username){this.username = username;}
/**
*
* @param {string} [DEFAULT = EN] User's IETF Language Tag (device dependant).
*/
set set_lang(lang){this.lang = lang;}
/**
*
* @param {int} [DEFAULT = 0] User's time zone relative to (UTC) Coordinated Universal Time.
*/
set set_timeZone(timeZone){this.timeZone = timeZone;}
/**
*
* @param {bool} [DEFAULT = false] Has the User restricted it's privacy forwarding settings?
*/
set set_isPrivate(isPrivate){this.isPrivate = isPrivate;}
/**
*
* @param {bool} [DEFAULT = false] Can use superior admin commands?
*/
set set_isSuperior(isSuperior){this.isSuperior = isSuperior;}
/**
*
* @param {bool} [DEFAULT = false] Is User admin?
*/
set set_isAdmin(isAdmin){this.isAdmin = isAdmin;}
/**
*
* @param {bool} [DEFAULT = false] Is User banned?
*/
set set_isBan(isBan){this.isBan = isBan;}
/**
*
* @param {bool} [DEFAULT = true] Does User have active chat with BOT?
*/
set set_isActive(isActive){this.isActive = isActive;}
}
module.exports = User; //Export the class