diff --git a/README.md b/README.md index e5dc1f1..70f0706 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,7 @@ Leek allows you to configure your bot just by using environment variables via th * SQL_USER: The user for the SQL connection (optional, but required if you want to use SQL support) * SQL_PASSWORD: The password for the SQL connection (optional, but required if you want to use SQL support) * SQL_DB: The name of the SQL database (optional, defaults to `discord`) +* SQL_WARNINGS: The [warning filter](https://docs.python.org/3/library/warnings.html#warning-filter) used for the SQL warnings (optional, defaults to `ignore`) #### Hyperping diff --git a/leek/__main__.py b/leek/__main__.py index 8bd8bfc..8bdb918 100644 --- a/leek/__main__.py +++ b/leek/__main__.py @@ -6,6 +6,7 @@ import logging import os import sys +import warnings from typing import Optional, Union from discord import Cog, Intents @@ -103,6 +104,8 @@ def main() -> None: finally: LOGGER.info("Added cog %s", name) + warnings.filterwarnings(os.environ.get("SQL_WARNINGS", "ignore"), module="aiomysql") + bot.run(os.environ["DISCORD_TOKEN"])