Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion astrbot/core/pipeline/context_utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import inspect
import traceback
import typing as T
import functools

from astrbot import logger
from astrbot.core.message.message_event_result import CommandResult, MessageEventResult
Expand Down Expand Up @@ -91,7 +92,10 @@ async def call_event_hook(
)
for handler in handlers:
try:
assert inspect.iscoroutinefunction(handler.handler)
_handler_fn = handler.handler
while isinstance(_handler_fn, functools.partial):
_handler_fn = _handler_fn.func
assert inspect.iscoroutinefunction(_handler_fn)
Comment thread
Aryunr marked this conversation as resolved.
logger.debug(
f"hook({hook_type.name}) -> {star_map[handler.handler_module_path].name} - {handler.handler_name}",
)
Expand Down