-
Notifications
You must be signed in to change notification settings - Fork 2
/
bot.py
39 lines (31 loc) · 891 Bytes
/
bot.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
# bot.py
import os
from dotenv import load_dotenv
load_dotenv()
TOKEN = os.getenv('DISCORD_TOKEN')
GUILD = int(os.getenv('GUILD_ID'))
CHANNEL = int(os.getenv('MONITOR_CHANNEL_ID'))
DB_FILE = f'{GUILD}-{CHANNEL}.sqlite'
CUSTOMIZATION = os.getenv('CUSTOMIZATION')
import constants
if CUSTOMIZATION == "metagame":
constants.apply_metagame_customization()
elif CUSTOMIZATION == "raidguild":
constants.apply_raidguild_customization()
else:
constants.apply_generic_string_formatting()
import bot
import repository
repo = repository.SqliteRepository(DB_FILE)
commands = [
bot.HelpCommand,
bot.InfoCommand,
bot.ListSkillsCommand,
bot.StatsCommand,
bot.AddSkillCommand,
bot.DrawFullGraphCommand,
bot.DrawWordCloudCommand,
bot.DrawPeopleSubgraphCommand,
bot.DrawSkillsSubgraphCommand,
]
bot.Controller(GUILD, CHANNEL, repo, commands).run(TOKEN)