aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Gareth Coles <[email protected]>2018-02-09 10:42:00 +0000
committerGravatar Gareth Coles <[email protected]>2018-02-09 10:42:00 +0000
commit04759d1670a0844d8772d5b5993ccec3ea8713ed (patch)
treea9b937d86ec8fa752bd7ac63e87212ea38585536
parentIgnore input on verification command (diff)
Make commands not case-sensitive
-rw-r--r--bot/__init__.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/bot/__init__.py b/bot/__init__.py
index 3358fc188..894a97021 100644
--- a/bot/__init__.py
+++ b/bot/__init__.py
@@ -3,13 +3,17 @@ import discord.ext.commands.view
def case_insensitive_skip_string(self, string: str):
- """Invokes the skip_string method from
- discord.ext.commands.view used to find
- the prefix in a message, but allows prefix
+ """Our version of the skip_string method from
+ discord.ext.commands.view; used to find
+ the prefix in a message, but allowing prefix
to ignore case sensitivity
"""
- string = string.lower()
- return _skip_string(self, string)
+ strlen = len(string)
+ if self.buffer.lower()[self.index:self.index + strlen] == string:
+ self.previous = self.index
+ self.index += strlen
+ return True
+ return False
def case_insensitive_get_word(self):