diff options
| author | 2020-02-13 10:20:45 -0800 | |
|---|---|---|
| committer | 2020-02-13 10:20:45 -0800 | |
| commit | 253073ad059fc3a8eac890b4f3fe006454aae4b0 (patch) | |
| tree | 3610a5bb7cfd8159a2866ee1a39861aefc4a48e2 | |
| parent | Bot: avoid DeprecationWarning for aiohttp.AsyncResolver (fix #748) (diff) | |
Bot: add warning for when connector is a specified kwarg
| -rw-r--r-- | bot/bot.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/bot/bot.py b/bot/bot.py index 95fbae17f..762d316bf 100644 --- a/bot/bot.py +++ b/bot/bot.py @@ -1,5 +1,6 @@ import logging import socket +import warnings from typing import Optional import aiohttp @@ -14,6 +15,11 @@ class Bot(commands.Bot): """A subclass of `discord.ext.commands.Bot` with an aiohttp session and an API client.""" def __init__(self, *args, **kwargs): + if "connector" in kwargs: + warnings.warn( + "If the bot is started, the connector will be overwritten with an internal one" + ) + super().__init__(*args, **kwargs) self.http_session: Optional[aiohttp.ClientSession] = None |