-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbot_config.py
44 lines (42 loc) · 2.76 KB
/
bot_config.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
import configparser
class BotConfig:
def __init__(self):
self.config = configparser.ConfigParser()
self.config.read('./setting.conf', encoding="utf-8_sig")
self.bot_token = self.config['default']['bot_token']
self.channel_ids = self.config['default']['channel_id'].split()
self.special_channel_ids = self.config['default']['special_channel_id'].split()
self.recruit_channel_ids = self.config['default']['recruit_channel_id'].split()
self.recruit_role_id = self.config['default']['recruit_role_id']
self.all_channel_ids = []
self.all_channel_ids.extend(self.channel_ids)
self.all_channel_ids.extend(self.special_channel_ids)
self.all_channel_ids.extend(self.recruit_channel_ids)
self.command_prefix = self.config['default']['command_prefix']
self.command_help = self.command_prefix + self.config['default']['command_help']
self.command_tier = self.command_prefix + self.config['default']['command_tier']
self.command_ship = self.command_prefix + self.config['default']['command_ship']
self.command_choice = self.command_prefix + self.config['default']['command_choice']
self.command_pickup = self.command_prefix + self.config['default']['command_pickup']
self.command_team = self.command_prefix + self.config['default']['command_team']
self.command_luck = self.command_prefix + self.config['default']['command_luck']
self.command_kuji = self.command_prefix + self.config['default']['command_kuji']
self.command_enter = self.command_prefix + self.config['default']['command_enter']
self.command_leave = self.command_prefix + self.config['default']['command_leave']
self.command_recruit_open = self.config['default']['command_recruit_open'].split()
self.command_recruit_close = self.config['default']['command_recruit_close'].split()
self.command_recruit_regist = self.config['default']['command_recruit_regist'].split()
self.command_exact_match = [self.command_help,
self.command_tier,
self.command_ship,
self.command_choice,
self.command_pickup,
self.command_team,
self.command_luck]
self.command_contain_match = []
self.command_contain_match.extend(self.command_recruit_open)
self.command_contain_match.extend(self.command_recruit_close)
self.command_contain_match.extend(self.command_recruit_regist)
self.release_commands = []
self.release_commands.extend(self.command_exact_match)
self.release_commands.extend(self.command_contain_match)