setup row adding/removal on guild changes, improved logging + basic command processing, add logging format to main file

This commit is contained in:
Xevion
2021-02-07 07:47:51 -06:00
parent 4527a3e427
commit 5f832de5f2
3 changed files with 60 additions and 6 deletions

14
main.py
View File

@@ -1,7 +1,19 @@
from contest import client
import logging
from contest import client, constants
if __name__ == "__main__":
bot = client.ContestClient()
logger = logging.getLogger(__file__)
logger.setLevel(constants.LOGGING_LEVEL)
logging.basicConfig(format='[%(asctime)s] [%(levelname)s] [%(funcName)s] %(message)s',
handlers=[
logging.FileHandler(f"bot.log", encoding='utf-8'),
logging.StreamHandler()
])
logger.info('Starting bot.')
with open('token.dat', 'r') as file:
bot.run(file.read())