diff options
author | 2018-04-20 20:05:01 +0200 | |
---|---|---|
committer | 2018-04-20 20:05:01 +0200 | |
commit | 32bb39b54f3458736877c24379c79539f5881039 (patch) | |
tree | 637562b6b9971b5a3608cb540a18e29bb8db811b | |
parent | Bump multidict from 4.1.0 to 4.2.0 (#50) (diff) |
Use discord.py's case insensitivity instead of patching `bot.cogs` ourselves (#55)
* Use d.py's case insensitivity instead of patching `bot.cogs`.
* Remove case insensitivity from `_get_word`.
-rw-r--r-- | bot/__init__.py | 2 | ||||
-rw-r--r-- | bot/__main__.py | 7 |
2 files changed, 2 insertions, 7 deletions
diff --git a/bot/__init__.py b/bot/__init__.py index c7d360408..d005c854d 100644 --- a/bot/__init__.py +++ b/bot/__init__.py @@ -232,8 +232,6 @@ def _get_word(self) -> str: self.end = len(self.buffer) log.trace(f"Mimicked command: {self.buffer}") - if isinstance(result, str): - return result.lower() # Case insensitivity, baby return result diff --git a/bot/__main__.py b/bot/__main__.py index 2bcf70adc..72e639851 100644 --- a/bot/__main__.py +++ b/bot/__main__.py @@ -6,7 +6,6 @@ from discord import Game from discord.ext.commands import AutoShardedBot, when_mentioned_or from bot.formatter import Formatter -from bot.utils import CaseInsensitiveDict bot = AutoShardedBot( command_prefix=when_mentioned_or( @@ -19,12 +18,10 @@ bot = AutoShardedBot( "name": "help()", "aliases": ["help"] }, - formatter=Formatter() + formatter=Formatter(), + case_insensitive=True ) -# Make cog names case-insensitive -bot.cogs = CaseInsensitiveDict() - # Global aiohttp session for all cogs - uses asyncio for DNS resolution instead of threads, so we don't *spam threads* bot.http_session = ClientSession(connector=TCPConnector(resolver=AsyncResolver())) |