v11.handle¶
v11 处理流相关接口¶
- melobot.protocols.onebot.v11.handle.msg_session() _AsyncGeneratorContextManager[Session] [源代码]¶
消息事件的会话上下文管理器
展开一个传统意义上的消息会话上下文,这与其他 bot 开发框架中的“会话”语义等价
- 返回类型:
_AsyncGeneratorContextManager[Session]
- melobot.protocols.onebot.v11.handle.on_event(checker: Checker | None | Callable[[Event], bool] = None, matcher: Matcher | None = None, parser: Parser | None = None, priority: HandleLevel = HandleLevel.NORMAL, block: bool = False, temp: bool = False) Callable[[AsyncCallable[..., bool | None]], Flow] [源代码]¶
- melobot.protocols.onebot.v11.handle.on_message(checker: Checker | None | Callable[[MessageEvent], bool] = None, matcher: Matcher | None = None, parser: Parser | None = None, priority: HandleLevel = HandleLevel.NORMAL, block: bool = False, temp: bool = False) Callable[[AsyncCallable[..., bool | None]], Flow] [源代码]¶
- 参数:
checker (Checker | None | Callable[[MessageEvent], bool])
matcher (Matcher | None)
parser (Parser | None)
priority (HandleLevel)
block (bool)
temp (bool)
- 返回类型:
Callable[[AsyncCallable[..., bool | None]], Flow]
- melobot.protocols.onebot.v11.handle.on_at_qq(qid: int | None = None, checker: Checker | None | Callable[[MessageEvent], bool] = None, matcher: Matcher | None = None, parser: Parser | None = None, priority: HandleLevel = HandleLevel.NORMAL, block: bool = False, temp: bool = False) Callable[[AsyncCallable[..., bool | None]], Flow] [源代码]¶
- 参数:
qid (int | None)
checker (Checker | None | Callable[[MessageEvent], bool])
matcher (Matcher | None)
parser (Parser | None)
priority (HandleLevel)
block (bool)
temp (bool)
- 返回类型:
Callable[[AsyncCallable[..., bool | None]], Flow]
- melobot.protocols.onebot.v11.handle.on_command(cmd_start: str | list[str], cmd_sep: str | list[str], targets: str | list[str], fmtters: list[CmdArgFormatter | None] | None = None, checker: Checker | None | Callable[[MessageEvent], bool] = None, matcher: Matcher | None = None, priority: HandleLevel = HandleLevel.NORMAL, block: bool = False, temp: bool = False) Callable[[AsyncCallable[..., bool | None]], Flow] [源代码]¶
- 参数:
- 返回类型:
Callable[[AsyncCallable[..., bool | None]], Flow]
- melobot.protocols.onebot.v11.handle.on_start_match(target: str | list[str], logic_mode: LogicMode = LogicMode.OR, checker: Checker | None | Callable[[MessageEvent], bool] = None, parser: Parser | None = None, priority: HandleLevel = HandleLevel.NORMAL, block: bool = False, temp: bool = False) Callable[[AsyncCallable[..., bool | None]], Flow] [源代码]¶
- melobot.protocols.onebot.v11.handle.on_contain_match(target: str | list[str], logic_mode: LogicMode = LogicMode.OR, checker: Checker | None | Callable[[MessageEvent], bool] = None, parser: Parser | None = None, priority: HandleLevel = HandleLevel.NORMAL, block: bool = False, temp: bool = False) Callable[[AsyncCallable[..., bool | None]], Flow] [源代码]¶
- melobot.protocols.onebot.v11.handle.on_full_match(target: str | list[str], logic_mode: LogicMode = LogicMode.OR, checker: Checker | None | Callable[[MessageEvent], bool] = None, parser: Parser | None = None, priority: HandleLevel = HandleLevel.NORMAL, block: bool = False, temp: bool = False) Callable[[AsyncCallable[..., bool | None]], Flow] [源代码]¶
- melobot.protocols.onebot.v11.handle.on_end_match(target: str | list[str], logic_mode: LogicMode = LogicMode.OR, checker: Checker | None | Callable[[MessageEvent], bool] = None, parser: Parser | None = None, priority: HandleLevel = HandleLevel.NORMAL, block: bool = False, temp: bool = False) Callable[[AsyncCallable[..., bool | None]], Flow] [源代码]¶
- melobot.protocols.onebot.v11.handle.on_regex_match(target: str, logic_mode: LogicMode = LogicMode.OR, checker: Checker | None | Callable[[MessageEvent], bool] = None, parser: Parser | None = None, priority: HandleLevel = HandleLevel.NORMAL, block: bool = False, temp: bool = False) Callable[[AsyncCallable[..., bool | None]], Flow] [源代码]¶
- 参数:
target (str)
logic_mode (LogicMode)
checker (Checker | None | Callable[[MessageEvent], bool])
parser (Parser | None)
priority (HandleLevel)
block (bool)
temp (bool)
- 返回类型:
Callable[[AsyncCallable[..., bool | None]], Flow]
- melobot.protocols.onebot.v11.handle.on_request(checker: Checker | None | Callable[[RequestEvent], bool] = None, matcher: Matcher | None = None, parser: Parser | None = None, priority: HandleLevel = HandleLevel.NORMAL, block: bool = False, temp: bool = False) Callable[[AsyncCallable[..., bool | None]], Flow] [源代码]¶
- 参数:
checker (Checker | None | Callable[[RequestEvent], bool])
matcher (Matcher | None)
parser (Parser | None)
priority (HandleLevel)
block (bool)
temp (bool)
- 返回类型:
Callable[[AsyncCallable[..., bool | None]], Flow]
- melobot.protocols.onebot.v11.handle.on_notice(checker: Checker | None | Callable[[NoticeEvent], bool] = None, matcher: Matcher | None = None, parser: Parser | None = None, priority: HandleLevel = HandleLevel.NORMAL, block: bool = False, temp: bool = False) Callable[[AsyncCallable[..., bool | None]], Flow] [源代码]¶
- 参数:
checker (Checker | None | Callable[[NoticeEvent], bool])
matcher (Matcher | None)
parser (Parser | None)
priority (HandleLevel)
block (bool)
temp (bool)
- 返回类型:
Callable[[AsyncCallable[..., bool | None]], Flow]
- melobot.protocols.onebot.v11.handle.on_meta(checker: Checker | None | Callable[[MetaEvent], bool] = None, matcher: Matcher | None = None, parser: Parser | None = None, priority: HandleLevel = HandleLevel.NORMAL, block: bool = False, temp: bool = False) Callable[[AsyncCallable[..., bool | None]], Flow] [源代码]¶