-
Notifications
You must be signed in to change notification settings - Fork 4
/
BotInfoManager.js
93 lines (73 loc) · 2.57 KB
/
BotInfoManager.js
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
class BotInfoManager {
constructor(token) {
this.token = token
}
getOperations() {
const self = this;
return {
getWebhookInfo: () => self.getWebhookInfo(),
deleteMyCommands: (objParam) => self.deleteMyCommands(objParam),
setMyCommands: (objParam) => self.setMyCommands(objParam),
getMyCommands: (objParam) => self.getMyCommands(objParam),
setMyName: (objParam) => self.setMyName(objParam),
getMyName: (objParam) => self.getMyName(objParam),
setMyDescription: (objParam) => self.setMyDescription(objParam),
getMyDescription: (objParam) => self.getMyDescription(objParam),
setMyShortDescription: (objParam) => self.setMyShortDescription(objParam),
getMyShortDescription: (objParam) => self.getMyShortDescription(objParam),
setMyDefaultAdministratorRights: (objParam) => self.setMyDefaultAdministratorRights(objParam),
getMyDefaultAdministratorRights: (objParam) => self.getMyDefaultAdministratorRights(objParam),
getMe: () => self.getMe(),
logOut: () => self.logOut(),
close: () => self.close(),
}
}
getWebhookInfo() {
return Utils.apiRequest(
this.token,
"getWebhookInfo"
)
};
deleteMyCommands(objParam) {
return Utils.apiRequest(this.token, "deleteMyCommands", objParam);
}
setMyCommands(objParam) {
return Utils.apiRequest(this.token, "setMyCommands", objParam);
}
getMyCommands(objParam) {
return Utils.apiRequest(this.token, "getMyCommands", objParam);
}
setMyName(objParam) {
return Utils.apiRequest(this.token, 'setMyName', objParam)
}
getMyName(objParam) {
return Utils.apiRequest(this.token, 'getMyName', objParam)
}
setMyDescription(objParam) {
return Utils.apiRequest(this.token, 'setMyDescription', objParam)
}
getMyDescription(objParam) {
return Utils.apiRequest(this.token, 'getMyDescription', objParam)
}
setMyShortDescription(objParam) {
return Utils.apiRequest(this.token, 'setMyShortDescription', objParam)
}
getMyShortDescription(objParam) {
return Utils.apiRequest(this.token, 'getMyShortDescription', objParam)
}
setMyDefaultAdministratorRights(objParam) {
return Utils.apiRequest(this.token, "setMyDefaultAdministratorRights", objParam);
}
getMyDefaultAdministratorRights(objParam) {
return Utils.apiRequest(this.token, "getMyDefaultAdministratorRights", objParam);
}
getMe() {
return Utils.apiRequest(this.token, "getMe")
}
logOut() {
return Utils.apiRequest(this.token, "logOut")
}
close() {
return Utils.apiRequest(this.token, "close");
}
}