diff --git a/adapters/qq/src/internal/group.ts b/adapters/qq/src/internal/group.ts index 82ba1213..5bba346d 100644 --- a/adapters/qq/src/internal/group.ts +++ b/adapters/qq/src/internal/group.ts @@ -14,7 +14,9 @@ declare module './internal' { sendPrivateMessage(openid: string, data: QQ.Message.Request): Promise sendFilePrivate(openid: string, data: QQ.Message.File.Request): Promise sendFileGuild(group_openid: string, data: QQ.Message.File.Request): Promise - acknowledgeInteraction(interaction_id: string, code: number): Promise + acknowledgeInteraction(interaction_id: string, data: { + code: number + }): Promise } } @@ -31,7 +33,7 @@ GroupInternal.define(false, { '/v2/groups/{channel.id}/files': { POST: 'sendFileGuild', }, - '/interactions/{interaction.id}/{interaction.token}/callback': { - POST: 'acknowledgeInteraction', + '/interactions/{interaction.id}': { + PUT: 'acknowledgeInteraction', }, }) diff --git a/adapters/qq/src/utils.ts b/adapters/qq/src/utils.ts index 2d209c3c..b9fbbc87 100644 --- a/adapters/qq/src/utils.ts +++ b/adapters/qq/src/utils.ts @@ -115,9 +115,11 @@ export async function adaptSession(bot: QQBot, i if (!['GROUP_AT_MESSAGE_CREATE', 'C2C_MESSAGE_CREATE', 'FRIEND_ADD', 'FRIEND_DEL', 'GROUP_ADD_ROBOT', 'GROUP_DEL_ROBOT', 'INTERACTION_CREATE'].includes(input.t)) { session = bot.guildBot.session() + session.setInternal(bot.guildBot.platform, input) + } else { + session.setInternal(bot.platform, input) } - session.setInternal(bot.platform, input) if (input.t === 'MESSAGE_CREATE' || input.t === 'AT_MESSAGE_CREATE' || input.t === 'DIRECT_MESSAGE_CREATE') { if (bot.config.type === 'private' && input.t === 'AT_MESSAGE_CREATE' && bot.config.intents & QQ.Intents.GUILD_MESSAGES) return session.type = 'message' @@ -212,7 +214,7 @@ export async function adaptSession(bot: QQBot, i // {message: 'get header appid failed', code: 630006} // {"message":"check app privilege not pass","code":11253 - bot.internal.acknowledgeInteraction(input.d.id, 0).catch(() => {}) + bot.internal.acknowledgeInteraction(input.d.id, { code: 0 }).catch(() => { }) } else if (input.t === 'GUILD_MEMBER_ADD' || input.t === 'GUILD_MEMBER_DELETE' || input.t === 'GUILD_MEMBER_UPDATE') { session.type = { GUILD_MEMBER_ADD: 'guild-member-added',