fix machine crashes?
This commit is contained in:
parent
be0933c928
commit
a0d491c71f
@ -830,13 +830,7 @@ class BotBase(GroupMixin):
|
|||||||
|
|
||||||
if not isinstance(ret, str):
|
if not isinstance(ret, str):
|
||||||
try:
|
try:
|
||||||
if self.case_insensitive_prefix:
|
ret = list(ret)
|
||||||
temp = []
|
|
||||||
for pre in ret:
|
|
||||||
temp += list(map(''.join, itertools.product(*((c.upper(), c.lower()) for c in pre))))
|
|
||||||
ret = temp
|
|
||||||
else:
|
|
||||||
ret = list(ret)
|
|
||||||
except TypeError:
|
except TypeError:
|
||||||
# It's possible that a generator raised this exception. Don't
|
# It's possible that a generator raised this exception. Don't
|
||||||
# replace it with our own error if that's the case.
|
# replace it with our own error if that's the case.
|
||||||
@ -850,7 +844,15 @@ class BotBase(GroupMixin):
|
|||||||
raise ValueError("Iterable command_prefix must contain at least one prefix")
|
raise ValueError("Iterable command_prefix must contain at least one prefix")
|
||||||
|
|
||||||
if self.case_insensitive_prefix:
|
if self.case_insensitive_prefix:
|
||||||
return list(map(''.join, itertools.product(*((c.upper(), c.lower()) for c in ret))))
|
if isinstance(ret, list):
|
||||||
|
temp = []
|
||||||
|
for pre in ret:
|
||||||
|
if pre in (self.user.mention + ' ', '<@!%s> ' % self.user.id):
|
||||||
|
continue
|
||||||
|
temp += list(map(''.join, itertools.product(*((c.upper(), c.lower()) for c in pre))))
|
||||||
|
ret = temp
|
||||||
|
else:
|
||||||
|
ret = list(map(''.join, itertools.product(*((c.upper(), c.lower()) for c in ret))))
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
async def get_context(self, message, *, cls=Context):
|
async def get_context(self, message, *, cls=Context):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user