[commands] Add ability to have case insensitive commands.

This is powered by a dict-like class for the people who want to opt-in
to the performance downgrade for usability for majority English
speaking users.

Since it is slower than the regular dict due to the excessive calls to
str.lower along with the possibilities of gotchas for other languages
outside of English, this is kept as False for the default case.
This commit is contained in:
Rapptz
2018-03-06 00:37:12 -05:00
parent 1590441dbf
commit 871a262ee3
2 changed files with 28 additions and 1 deletions

View File

@ -947,6 +947,10 @@ class Bot(BotBase, discord.Client):
multiple checks for the prefix should be used and the first one to
match will be the invocation prefix. You can get this prefix via
:attr:`.Context.prefix`.
case_insensitive: :class:`bool`
Whether the commands should be case insensitive. Defaults to ``False``. This
attribute does not carry over to groups. You must set it to every group if
you require group commands to be case insensitive as well.
description : :class:`str`
The content prefixed into the default help message.
self_bot : :class:`bool`