From 0ab366fcac9a10ce32a359dbd4573bdf76c2f3a4 Mon Sep 17 00:00:00 2001 From: Guanchao Wang Date: Tue, 7 Oct 2025 00:06:07 +0800 Subject: [PATCH] Fix/qqo (#1709) * fix: qq official * fix: appid --- pkg/platform/sources/qqofficial.py | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/pkg/platform/sources/qqofficial.py b/pkg/platform/sources/qqofficial.py index 28a09d8c..240b46d0 100644 --- a/pkg/platform/sources/qqofficial.py +++ b/pkg/platform/sources/qqofficial.py @@ -139,19 +139,15 @@ class QQOfficialAdapter(abstract_platform_adapter.AbstractMessagePlatformAdapter event_converter: QQOfficialEventConverter = QQOfficialEventConverter() def __init__(self, config: dict, logger: EventLogger): - self.config = config - self.logger = logger + bot = QQOfficialClient( + app_id=config['appid'], secret=config['secret'], token=config['token'], logger=logger + ) - required_keys = [ - 'appid', - 'secret', - ] - missing_keys = [key for key in required_keys if key not in config] - if missing_keys: - raise command_errors.ParamNotEnoughError('QQ官方机器人缺少相关配置项,请查看文档或联系管理员') - - self.bot = QQOfficialClient( - app_id=config['appid'], secret=config['secret'], token=config['token'], logger=self.logger + super().__init__( + config=config, + logger=logger, + bot=bot, + bot_account_id=config['appid'], ) async def reply_message(