Skip to content

Commit

Permalink
Allow aiomysql warnings to be toggled off
Browse files Browse the repository at this point in the history
  • Loading branch information
justalemon committed Jul 5, 2024
1 parent b0f850d commit c693b5c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions leek/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import logging
import os
import sys
import warnings
from typing import Optional, Union

from discord import Cog, Intents
Expand Down Expand Up @@ -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"])


Expand Down

0 comments on commit c693b5c

Please sign in to comment.