From 2b85a43956595ef0aaba66cd7bb5869b34603826 Mon Sep 17 00:00:00 2001 From: Richard Chien Date: Sat, 21 Jul 2018 22:01:14 +0800 Subject: [PATCH] Ignore case when checking nicknames --- none/natural_language.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/none/natural_language.py b/none/natural_language.py index 146e49b1..563f4d95 100644 --- a/none/natural_language.py +++ b/none/natural_language.py @@ -87,7 +87,7 @@ async def handle_natural_language(bot: NoneBot, ctx: Dict[str, Any]) -> bool: else: # noinspection PyUnusedLocal nicknames = filter(lambda n: n, bot.config.NICKNAME) - m = re.search(rf'^({"|".join(nicknames)})[\s,,]+', msg) + m = re.search(rf'^({"|".join(nicknames)})[\s,,]+', msg, re.IGNORECASE) if m: logger.debug(f'User is calling me {m.group(1)}') ctx['to_me'] = True