This commit is contained in:
2025-02-21 20:46:50 +01:00
commit 2e7aa9a37a
31 changed files with 1454 additions and 0 deletions

13
src/discord_logger.py Normal file
View File

@@ -0,0 +1,13 @@
import logging
class DiscordLogger(logging.Handler):
def __init__(self, client, channel, level) -> None:
super().__init__(level)
self.client = client
self.channel = channel
def emit(self, record: logging.LogRecord):
message = "**{}**\n```\n{}\n```".format(record.levelname, record.getMessage())
self.client.loop.create_task(self.channel.send(message))