Skip to content

Commit

Permalink
feat(qq): support separate internal APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Dec 22, 2023
1 parent 6444d35 commit bf6bdea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion adapters/qq/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import * as QQ from './types'
import { QQBot } from './bot'
import { GroupInternal } from './internal/group'
import { GuildInternal } from './internal/guild'

export { QQ }

Expand All @@ -21,7 +23,8 @@ type QQEvents = {

declare module '@satorijs/core' {
interface Session {
qq?: QQ.Payload
qq?: QQ.Payload & GroupInternal
qqguild?: QQ.Payload & GuildInternal
}

interface Events extends QQEvents {}
Expand Down
2 changes: 1 addition & 1 deletion adapters/qq/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export async function adaptSession<C extends Context = Context>(bot: QQBot<C>, i
session = bot.guildBot.session()
}

session.setInternal('qq', 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'
Expand Down

0 comments on commit bf6bdea

Please sign in to comment.