mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-11-28 07:50:16 +08:00
Ignore some inspection
This commit is contained in:
parent
b00e31ad84
commit
89a11ab6e9
@ -82,8 +82,10 @@ async def handle_natural_language(bot: NoneBot, ctx: Dict[str, Any]) -> bool:
|
|||||||
if bot.config.NICKNAME:
|
if bot.config.NICKNAME:
|
||||||
# check if the user is calling me with my nickname
|
# check if the user is calling me with my nickname
|
||||||
if not isinstance(bot.config.NICKNAME, Iterable):
|
if not isinstance(bot.config.NICKNAME, Iterable):
|
||||||
|
# noinspection PyUnusedLocal
|
||||||
nicknames = (bot.config.NICKNAME,)
|
nicknames = (bot.config.NICKNAME,)
|
||||||
else:
|
else:
|
||||||
|
# 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)
|
||||||
if m:
|
if m:
|
||||||
|
Loading…
Reference in New Issue
Block a user