Skip to content

Commit

Permalink
fix(qq): wrong interaction api
Browse files Browse the repository at this point in the history
  • Loading branch information
XxLittleCxX committed Jan 25, 2024
1 parent 66b9671 commit 63ca479
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions adapters/qq/src/internal/group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ declare module './internal' {
sendPrivateMessage(openid: string, data: QQ.Message.Request): Promise<any>
sendFilePrivate(openid: string, data: QQ.Message.File.Request): Promise<any>
sendFileGuild(group_openid: string, data: QQ.Message.File.Request): Promise<any>
acknowledgeInteraction(interaction_id: string, code: number): Promise<any>
acknowledgeInteraction(interaction_id: string, data: {
code: number
}): Promise<any>
}
}

Expand All @@ -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',
},
})
2 changes: 1 addition & 1 deletion adapters/qq/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ export async function adaptSession<C extends Context = Context>(bot: QQBot<C>, 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',
Expand Down

0 comments on commit 63ca479

Please sign in to comment.