🐛 fix args_parser: dont ignore if exists

This commit is contained in:
yanyongyu 2020-09-22 11:28:38 +08:00
parent 342d879add
commit e68ce8b3a9

View File

@ -6,8 +6,8 @@ import typing
import inspect import inspect
from functools import wraps from functools import wraps
from datetime import datetime from datetime import datetime
from contextvars import ContextVar
from collections import defaultdict from collections import defaultdict
from contextvars import Context, ContextVar, copy_context
from nonebot.rule import Rule from nonebot.rule import Rule
from nonebot.permission import Permission, USER from nonebot.permission import Permission, USER
@ -166,8 +166,8 @@ class Matcher(metaclass=MatcherMeta):
raise PausedException raise PausedException
async def _key_parser(bot: Bot, event: Event, state: dict): async def _key_parser(bot: Bot, event: Event, state: dict):
if key in state: # if key in state:
return # return
parser = args_parser or cls._default_parser parser = args_parser or cls._default_parser
if parser: if parser:
await parser(bot, event, state) await parser(bot, event, state)
@ -252,6 +252,7 @@ class Matcher(metaclass=MatcherMeta):
temp=True, temp=True,
priority=0, priority=0,
block=True, block=True,
module=self.module,
default_state=self.state, default_state=self.state,
expire_time=datetime.now() + bot.config.session_expire_timeout) expire_time=datetime.now() + bot.config.session_expire_timeout)
except PausedException: except PausedException:
@ -263,6 +264,7 @@ class Matcher(metaclass=MatcherMeta):
temp=True, temp=True,
priority=0, priority=0,
block=True, block=True,
module=self.module,
default_state=self.state, default_state=self.state,
expire_time=datetime.now() + bot.config.session_expire_timeout) expire_time=datetime.now() + bot.config.session_expire_timeout)
except FinishedException: except FinishedException: