-
Notifications
You must be signed in to change notification settings - Fork 1
/
command_session.py
77 lines (55 loc) · 2.24 KB
/
command_session.py
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
from graia.application import Group, GroupMessage
from init_bot import *
def is_manager(message: GroupMessage) -> bool:
test = message.sender.permission
if message.sender.permission.value == "ADMINISTRATOR" or message.sender.permission.value == "OWNER" or message.sender.id in Manager:
return True
return False
def open_welcome(message: GroupMessage, group: Group) -> bool:
if not group_is_in_list(message, group, WelComeGroup):
WelComeGroup.append(group.id)
return True
return False
def close_welcome(message: GroupMessage, group: Group) -> bool:
if group_is_in_list(message, group, WelComeGroup):
WelComeGroup.remove(group.id)
return True
return False
def only_group_in_list(group: Group, start_group: list) -> bool:
if group.id in start_group:
return True
return False
def group_is_in_list(message: GroupMessage, group: Group, start_group: list) -> bool:
if is_manager(message) and group.id in start_group:
return True
return False
def shutdown_Baidu(message: GroupMessage, group: Group) -> bool:
if group_is_in_list(message, group, start_baiDu_group):
start_baiDu_group.remove(group.id)
return True
return False
def open_manager(message: GroupMessage, group: Group) -> bool:
if not group_is_in_list(message, group, mast_manager_group):
mast_manager_group.append(group.id)
return True
return False
def close_manager(message: GroupMessage, group: Group) -> bool:
if group_is_in_list(message, group, mast_manager_group):
mast_manager_group.remove(group.id)
return True
return False
def shutdown_all(message: GroupMessage, group: Group) -> bool:
if not group_is_in_list(message, group, shutdown_all_group):
shutdown_all_group.append(group.id)
return True
return False
def start_Baidu(message: GroupMessage, group: Group) -> bool:
if not group_is_in_list(message, group, start_baiDu_group):
start_baiDu_group.append(group.id)
return True
return False
def start_all(message: GroupMessage, group: Group) -> bool:
if group_is_in_list(message, group, shutdown_all_group):
shutdown_all_group.remove(group.id)
return True
return False