-
Notifications
You must be signed in to change notification settings - Fork 54
/
Copy pathPermission.js
56 lines (45 loc) · 1.05 KB
/
Permission.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
function hasPermission(id) {
var hasPermission = false;
if (id === 539065210) {
hasPermission = true;
}
if (id === 502754117) {
hasPermission = true;
}
return hasPermission;
}
function allowed(body, paras, origParas) {
if (isCallback(body)) {
return true;
}
var share = getShareObject(body);
if (share.chat.type == "private") {
return true;
}
if (body.message.new_chat_member) {
return true;
}
// allow feng
if (body.message.text.indexOf("/!") == 0) {
if (share.from.id == 539065210) {
return true;
}
}
if (isAdminOrCreator(share.from.id, share.chat.id)) {
return true;
}
// Allow people who have draw secret to join the draw
if (body.message.text.indexOf("/draw join now") == 0) {
return true;
}
if (body.message.text.indexOf("/draw show") == 0) {
return true;
}
return false;
}
function isCallback(body) {
if (body.callback_query) {
return true;
}
return false;
}