mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-11-24 09:05:04 +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:
|
||||
# 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
|
||||
|
Loading…
Reference in New Issue
Block a user