diff --git a/pybot-f.py b/pybot-f.py index 6e176e2..7b7da4b 100644 --- a/pybot-f.py +++ b/pybot-f.py @@ -8,25 +8,29 @@ import typing from discord.ext import commands import logging -logger = logging.getLogger('discord') -logger.setLevel(logging.DEBUG) -handler = logging.FileHandler(filename='discord.log', encoding='utf-8', mode='w') -handler.setFormatter(logging.Formatter('%(asctime)s:%(levelname)s:%(name)s: %(message)s')) -logger.addHandler(handler) +# Logging +loghandler = logging.FileHandler(filename='pybot-f.log', encoding='utf-8', mode='w') +# The bots' description description = '''Testing this bot stuff :)''' + +# Intents intents = discord.Intents.default() intents.members = True intents.message_content = True + # Config loading config = configparser.ConfigParser() config.read('bot.ini') + bottoken = config['General']['bottoken'] +loglevel = logging.getLevelName(config['General']['loglevel']) -bot = commands.Bot(command_prefix='.', description=description, intents=intents) +# Setting up commands.Bot +bot = commands.Bot(command_prefix='.', description=description, intents=intents, log_handler=loghandler, log_level=loglevel) @bot.event