From bf6bdea8d4f80ba6a84f99c4394870c9eaa1f89e Mon Sep 17 00:00:00 2001 From: Shigma Date: Fri, 22 Dec 2023 15:59:20 +0800 Subject: [PATCH] feat(qq): support separate internal APIs --- adapters/qq/src/index.ts | 5 ++++- adapters/qq/src/utils.ts | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/adapters/qq/src/index.ts b/adapters/qq/src/index.ts index e873a53d..d865086c 100644 --- a/adapters/qq/src/index.ts +++ b/adapters/qq/src/index.ts @@ -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 } @@ -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 {} diff --git a/adapters/qq/src/utils.ts b/adapters/qq/src/utils.ts index be8ac41a..d2e65eab 100644 --- a/adapters/qq/src/utils.ts +++ b/adapters/qq/src/utils.ts @@ -117,7 +117,7 @@ export async function adaptSession(bot: QQBot, 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'