forked from Adikso/BashBot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bashbot.py
39 lines (27 loc) · 829 Bytes
/
bashbot.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
import logging
from discord import LoginFailure
from bashbot.bot import BashBot
from bashbot.settings import settings
from bashbot.utils import get_logger
logger = get_logger('Launcher')
def setup_logger():
logging.basicConfig(
level=logging.INFO,
format='[%(asctime)s] %(levelname)s:%(name)s: %(message)s',
datefmt='%Y-%m-%d %H:%M:%S'
)
def launch():
setup_logger()
settings().load()
settings().load_macros()
prefix = settings().get('commands.prefixes', ['$'])[0]
token = settings().get('discord.token')
if token == 'TOKEN_HERE':
logger.error('You need to specify bot TOKEN in config.toml')
return
try:
BashBot(prefix).run(token)
except LoginFailure as e:
logger.error(e.args[0])
if __name__ == '__main__':
launch()