-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.py
41 lines (31 loc) · 935 Bytes
/
run.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
from bot import AnnivBot
from settings import Setting
from discord.ext.commands import ExtensionError
import logging
import traceback
# Load configuration
conf = Setting()
print(conf.conf)
# Load logger
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(conf.conf["Bot"]["name"])
# Define bot
client = AnnivBot(conf)
# Register cog extensions
cogs = [
"cogs.logger",
"cogs.joingiver",
]
logger.info("Loading {} extensions".format(len(cogs)))
for cog in cogs:
try:
client.load_extension(cog)
except ExtensionError as ex:
logger.warning("Error {} was occured when loading cog extension '{}'\n{}".format(
ex.__class__.__name__, cog, traceback.format_exc()
))
logger.info("Loaded {} extensions".format(len(client.extensions)))
logger.info("Loaded {} commands: {}".format(
len(client.commands), [x.name for x in client.commands]
))
client.kick()