diff --git a/src/core/services/NodeIKernelBuddyService.ts b/src/core/services/NodeIKernelBuddyService.ts index 9273d05d..ac96b5a3 100644 --- a/src/core/services/NodeIKernelBuddyService.ts +++ b/src/core/services/NodeIKernelBuddyService.ts @@ -114,7 +114,7 @@ export interface NodeIKernelBuddyService { reportDoubtBuddyReqUnread(): void; - getBuddyRecommendContactArkJson(uid: string, phoneNumber: string): Promise; + getBuddyRecommendContactArkJson(uid: string, phoneNumber: string): Promise; isNull(): boolean; } diff --git a/src/onebot/api/msg.ts b/src/onebot/api/msg.ts index c8090c0b..4f056038 100644 --- a/src/onebot/api/msg.ts +++ b/src/onebot/api/msg.ts @@ -607,6 +607,14 @@ export class OneBotMsgApi { }), [OB11MessageDataType.miniapp]: async () => undefined, + + [OB11MessageDataType.contact]: async ({ data }, context) => { + let arkJson = await this.core.apis.UserApi.getBuddyRecommendContactArkJson(data.qq, ''); + return this.ob11ToRawConverters.json({ + data: { data: arkJson.arkMsg }, + type: OB11MessageDataType.json + }, context); + } }; constructor(obContext: NapCatOneBot11Adapter, core: NapCatCore) { diff --git a/src/onebot/types/message.ts b/src/onebot/types/message.ts index bf2f3530..1386aa52 100644 --- a/src/onebot/types/message.ts +++ b/src/onebot/types/message.ts @@ -62,6 +62,7 @@ export enum OB11MessageDataType { dice = 'dice', RPS = 'rps', miniapp = 'miniapp',//json类 + contact = 'contact', Location = 'location' } @@ -81,10 +82,15 @@ export interface OB11MessageText { text: string, // 纯文本 } } - +export interface OB11MessageContext { + type: OB11MessageDataType.contact, + data: { + qq: string, + } +} export interface OB11MessageFileBase { data: { - file_unique?:string, + file_unique?: string, path?: string; thumb?: string; name?: string; @@ -198,7 +204,7 @@ export type OB11MessageData = OB11MessageAt | OB11MessageReply | OB11MessageImage | OB11MessageRecord | OB11MessageFile | OB11MessageVideo | OB11MessageNode | OB11MessageIdMusic | OB11MessageCustomMusic | OB11MessageJson | - OB11MessageDice | OB11MessageRPS | OB11MessageMarkdown | OB11MessageForward + OB11MessageDice | OB11MessageRPS | OB11MessageMarkdown | OB11MessageForward | OB11MessageContext export interface OB11PostSendMsg { message_type?: 'private' | 'group'