mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-01-19 01:18:19 +08:00
🚧 update process
This commit is contained in:
parent
f4cea065d8
commit
6c08982ca7
@ -421,13 +421,13 @@ class Bot(BaseBot):
|
||||
"""
|
||||
msg = message if isinstance(message, Message) else Message(message)
|
||||
|
||||
at_sender = at_sender and bool(event.user_id)
|
||||
at_sender = at_sender and hasattr(event, "user_id")
|
||||
|
||||
params = {}
|
||||
if event.user_id:
|
||||
params["user_id"] = event.user_id
|
||||
if event.group_id:
|
||||
params["group_id"] = event.group_id
|
||||
if hasattr(event, "user_id"):
|
||||
params["user_id"] = getattr(event, "user_id")
|
||||
if hasattr(event, "group_id"):
|
||||
params["group_id"] = getattr(event, "group_id")
|
||||
params.update(kwargs)
|
||||
|
||||
if "message_type" not in params:
|
||||
|
@ -11,7 +11,6 @@ from typing import Set, Type, Optional, Iterable, TYPE_CHECKING
|
||||
|
||||
from nonebot.log import logger
|
||||
from nonebot.rule import TrieRule
|
||||
from nonebot.utils import escape_tag
|
||||
from nonebot.matcher import matchers, Matcher
|
||||
from nonebot.exception import IgnoredException, StopPropagation, NoLogException
|
||||
from nonebot.typing import State, EventPreProcessor, RunPreProcessor, EventPostProcessor, RunPostProcessor
|
||||
@ -131,7 +130,7 @@ async def _check_matcher(priority: int, bot: "Bot", event: "Event",
|
||||
]
|
||||
results = await asyncio.gather(*checking_tasks, return_exceptions=True)
|
||||
expired = await asyncio.gather(*checking_expire_tasks)
|
||||
for expired_matcher in filter(lambda x: x and x in results, expired):
|
||||
for expired_matcher in filter(lambda x: x, expired):
|
||||
try:
|
||||
matchers[priority].remove(expired_matcher) # type: ignore
|
||||
except Exception:
|
||||
|
Loading…
Reference in New Issue
Block a user