feat: contact

This commit is contained in:
手瓜一十雪 2024-09-16 18:47:51 +08:00
parent e9ede6924e
commit c145935d46
3 changed files with 18 additions and 4 deletions

View File

@ -114,7 +114,7 @@ export interface NodeIKernelBuddyService {
reportDoubtBuddyReqUnread(): void;
getBuddyRecommendContactArkJson(uid: string, phoneNumber: string): Promise<unknown>;
getBuddyRecommendContactArkJson(uid: string, phoneNumber: string): Promise<GeneralCallResult & { arkMsg: string }>;
isNull(): boolean;
}

View File

@ -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) {

View File

@ -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'