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>;
|
setMemberShutUp(groupCode: string, memberTimes: { uid: string, timeStamp: number }[]): Promise<void>;
|
||||||
|
|
||||||
getGroupRecommendContactArkJson(groupCode: string): unknown;
|
getGroupRecommendContactArkJson(groupCode: string): Promise<GeneralCallResult & { arkJson: string }>;
|
||||||
|
|
||||||
getJoinGroupLink(param: {
|
getJoinGroupLink(param: {
|
||||||
groupCode: string,
|
groupCode: string,
|
||||||
|
@ -624,12 +624,20 @@ export class OneBotMsgApi {
|
|||||||
|
|
||||||
[OB11MessageDataType.miniapp]: async () => undefined,
|
[OB11MessageDataType.miniapp]: async () => undefined,
|
||||||
|
|
||||||
[OB11MessageDataType.contact]: async ({ data }, context) => {
|
[OB11MessageDataType.contact]: async ({ data: { type = "qq", id } }, context) => {
|
||||||
const arkJson = await this.core.apis.UserApi.getBuddyRecommendContactArkJson(data.id.toString(), '');
|
if(type === "qq"){
|
||||||
return this.ob11ToRawConverters.json({
|
const arkJson = await this.core.apis.UserApi.getBuddyRecommendContactArkJson(id.toString(), '');
|
||||||
data: { data: arkJson.arkMsg },
|
return this.ob11ToRawConverters.json({
|
||||||
type: OB11MessageDataType.json
|
data: { data: arkJson.arkMsg },
|
||||||
}, context);
|
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 {
|
export interface OB11MessageContext {
|
||||||
type: OB11MessageDataType.contact,
|
type: OB11MessageDataType.contact,
|
||||||
data: {
|
data: {
|
||||||
|
type:"qq"|"group",
|
||||||
id: string,
|
id: string,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user