mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-21 09:36:35 +00:00
优化 contact 支持群聊和私聊
This commit is contained in:
parent
29a8db96f4
commit
b3fbe9e34a
@ -239,7 +239,7 @@ export interface NodeIKernelGroupService {
|
||||
|
||||
setMemberShutUp(groupCode: string, memberTimes: { uid: string, timeStamp: number }[]): Promise<void>;
|
||||
|
||||
getGroupRecommendContactArkJson(groupCode: string): unknown;
|
||||
getGroupRecommendContactArkJson(groupCode: string): Promise<GeneralCallResult & { arkJson: string }>;
|
||||
|
||||
getJoinGroupLink(param: {
|
||||
groupCode: string,
|
||||
|
@ -624,12 +624,20 @@ export class OneBotMsgApi {
|
||||
|
||||
[OB11MessageDataType.miniapp]: async () => undefined,
|
||||
|
||||
[OB11MessageDataType.contact]: async ({ data }, context) => {
|
||||
const arkJson = await this.core.apis.UserApi.getBuddyRecommendContactArkJson(data.id.toString(), '');
|
||||
return this.ob11ToRawConverters.json({
|
||||
data: { data: arkJson.arkMsg },
|
||||
type: OB11MessageDataType.json
|
||||
}, context);
|
||||
[OB11MessageDataType.contact]: async ({ data: { type = "qq", id } }, context) => {
|
||||
if(type === "qq"){
|
||||
const arkJson = await this.core.apis.UserApi.getBuddyRecommendContactArkJson(id.toString(), '');
|
||||
return this.ob11ToRawConverters.json({
|
||||
data: { data: arkJson.arkMsg },
|
||||
type: OB11MessageDataType.json
|
||||
}, context);
|
||||
}else if(type === "group"){
|
||||
const arkJson = await this.core.apis.GroupApi.getGroupRecommendContactArkJson(id.toString());
|
||||
return this.ob11ToRawConverters.json({
|
||||
data: { data: arkJson.arkJson },
|
||||
type: OB11MessageDataType.json
|
||||
}, context);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -85,6 +85,7 @@ export interface OB11MessageText {
|
||||
export interface OB11MessageContext {
|
||||
type: OB11MessageDataType.contact,
|
||||
data: {
|
||||
type:"qq"|"group",
|
||||
id: string,
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user