mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-11-28 05:06:56 +08:00
Ignore case when checking nicknames
This commit is contained in:
parent
2caf90646b
commit
2b85a43956
@ -87,7 +87,7 @@ async def handle_natural_language(bot: NoneBot, ctx: Dict[str, Any]) -> bool:
|
|||||||
else:
|
else:
|
||||||
# noinspection PyUnusedLocal
|
# noinspection PyUnusedLocal
|
||||||
nicknames = filter(lambda n: n, bot.config.NICKNAME)
|
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:
|
if m:
|
||||||
logger.debug(f'User is calling me {m.group(1)}')
|
logger.debug(f'User is calling me {m.group(1)}')
|
||||||
ctx['to_me'] = True
|
ctx['to_me'] = True
|
||||||
|
Loading…
Reference in New Issue
Block a user