For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /reference/sdk/sapi/runtime/functions/registerSystemMsgHandler.md.
  • 简体中文
  • Function: registerSystemMsgHandler()

    function registerSystemMsgHandler(handler: (player: Player, text: string) => void): () => void;

    Defined in: sapi/runtime/msg.ts:15

    注册系统频道消息转发回调(例如同步转发至 QQ 桥等外部通道)。 每次通过 Msg.* 发送消息时均会同步触发此回调;传入空实现或 null 可关闭转发。

    Parameters

    ParameterTypeDescription
    handler(player: Player, text: string) => void接收目标玩家与消息文本的转发回调函数。

    Returns

    () => void