/** * OneBot 12 事件与 zhin Message 的转换、消息段转换 */ import type { SendContent } from 'zhin.js'; import type { OneBot12Event, OneBot12Segment } from './types.js'; /** 判断是否为消息事件(type=message) */ export declare function isMessageEvent(ev: OneBot12Event): ev is OneBot12Event & { message_id: string; message?: OneBot12Segment[]; }; /** 从事件得到 zhin 场景 id:私聊 user_id,群 group_id,频道 channel_id 或 guild_id:channel_id */ export declare function getChannelId(ev: OneBot12Event): string; /** 从事件得到 channel 类型 */ export declare function getChannelType(ev: OneBot12Event): 'private' | 'group'; /** 将 OneBot 12 消息事件转为 zhin Message 的 MessageBase 所需字段 */ export declare function formatOneBot12MessagePayload(ev: OneBot12Event, endpointName: string, recallFn: (msgId: string) => Promise, replyFn: (channel: { id: string; type: 'group' | 'private'; }, content: (string | { type: string; data?: Record; })[], quote?: boolean | string) => Promise): { $id: string; $adapter: 'onebot12'; $endpoint: string; $channel: { id: string; type: 'group' | 'private'; }; $sender: { id: string; name: string; }; $content: Array<{ type: string; data: Record; }>; $raw: string; $timestamp: number; $recall: () => Promise; $reply: (content: SendContent, quote?: boolean | string) => Promise; }; /** 将 zhin 的 content(segment 数组或字符串)转为 OneBot 12 message 段数组;简单实现仅 text */ export declare function contentToOb12Segments(content: SendContent): OneBot12Segment[]; //# sourceMappingURL=utils.d.ts.map