mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-16 04:45:46 +00:00
feat: contact
This commit is contained in:
parent
e9ede6924e
commit
c145935d46
@ -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;
|
||||
}
|
||||
|
@ -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) {
|
||||
|
@ -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'
|
||||
|
Loading…
Reference in New Issue
Block a user