changed logging. its still not working somehow. ill try to fix it.
This commit is contained in:
parent
7972b083c8
commit
7447c301dd
1 changed files with 10 additions and 6 deletions
16
pybot-f.py
16
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
|
||||
|
|
Loading…
Add table
Reference in a new issue