diff --git a/OlivOS/adapter/qqGuild/qqGuildv2SDK.py b/OlivOS/adapter/qqGuild/qqGuildv2SDK.py index 6206e5bd..b944deae 100644 --- a/OlivOS/adapter/qqGuild/qqGuildv2SDK.py +++ b/OlivOS/adapter/qqGuild/qqGuildv2SDK.py @@ -181,12 +181,12 @@ def __init__(self, bot_info:bot_info_T, intents=(int(intents_T.GUILDS) | int(int if bot_info.model == 'private': tmp_intents |= int(intents_T.GUILD_MESSAGES) #tmp_intents |= int(intents_T.QQ_MESSAGES) - elif bot_info.model == 'public': + elif bot_info.model == ['public', 'sandbox']: tmp_intents |= int(intents_T.PUBLIC_GUILD_MESSAGES) tmp_intents |= int(intents_T.PUBLIC_QQ_MESSAGES) elif bot_info.model == 'public_guild_only': tmp_intents |= int(intents_T.PUBLIC_GUILD_MESSAGES) - elif bot_info.model in ['private_intents', 'public_intents']: + elif bot_info.model in ['private_intents', 'public_intents', 'sandbox_intents']: tmp_intents = bot_info.intents payload_template.__init__(self) self.data.op = 2 @@ -232,8 +232,15 @@ def __init__(self): self.route = None self.res = None + def __switch_host(self): + global sdkAPIHost + if self.bot_info.model in ['sandbox', 'sandbox_intents']: + if self.host == sdkAPIHost['default']: + self.host = sdkAPIHost['sandbox'] + def do_api_plant(self, req_type='POST'): try: + self.__switch_host() tmp_payload_dict = {} tmp_sdkAPIRouteTemp = sdkAPIRouteTemp.copy() if self.metadata is not None: @@ -264,6 +271,7 @@ def do_api_plant(self, req_type='POST'): def do_api(self, req_type='POST'): try: + self.__switch_host() tmp_payload_dict = {} tmp_sdkAPIRouteTemp = sdkAPIRouteTemp.copy() if self.metadata is not None: diff --git a/OlivOS/core/core/messageAPI.py b/OlivOS/core/core/messageAPI.py index 87dc67de..f481fc0e 100644 --- a/OlivOS/core/core/messageAPI.py +++ b/OlivOS/core/core/messageAPI.py @@ -69,8 +69,12 @@ }, 'qqGuildv2_link': { 'default': 'olivos_para', + 'sandbox': 'olivos_para', + 'sandbox_intents': 'olivos_para', 'private': 'olivos_para', - 'public': 'olivos_para' + 'private_intents': 'olivos_para', + 'public': 'olivos_para', + 'public_intents': 'olivos_para' } }, 'telegram': { diff --git a/OlivOS/nativeGUI/multiLoginUIAPI.py b/OlivOS/nativeGUI/multiLoginUIAPI.py index f7582637..636a744d 100644 --- a/OlivOS/nativeGUI/multiLoginUIAPI.py +++ b/OlivOS/nativeGUI/multiLoginUIAPI.py @@ -375,6 +375,8 @@ def __init__(self, action, Account_data, hash_key=None, edit_commit_callback=Non 'QQ官方/公域/V2/指定intents', 'QQ官方/私域/V2', 'QQ官方/私域/V2/指定intents', + 'QQ官方/沙盒/V2', + 'QQ官方/沙盒/V2/指定intents', 'QQ官方/公域/V1', 'QQ官方/私域/V1', 'Discord', @@ -710,6 +712,17 @@ def __init__(self, action, Account_data, hash_key=None, edit_commit_callback=Non 'intents': 'edit_root_Entry_Server_port' } ], + 'QQ官方/沙盒/V2': ['qqGuild', 'qqGuildv2_link', 'sandbox', 'True', 'websocket', { + 'AppID': 'edit_root_Entry_ID', + 'AppSecret': 'edit_root_Entry_Server_access_token' + } + ], + 'QQ官方/沙盒/V2/指定intents': ['qqGuild', 'qqGuildv2_link', 'sandbox_intents', 'True', 'websocket', { + 'AppID': 'edit_root_Entry_ID', + 'AppSecret': 'edit_root_Entry_Server_access_token', + 'intents': 'edit_root_Entry_Server_port' + } + ], 'Telegram': ['telegram', 'telegram_poll', 'default', 'True', 'post', { 'TOKEN': 'edit_root_Entry_Server_access_token' } @@ -891,6 +904,8 @@ def __init__(self, action, Account_data, hash_key=None, edit_commit_callback=Non 'public_intents', 'private', 'private_intents', + 'sandbox', + 'sandbox_intents', 'default' ] }, @@ -1046,7 +1061,8 @@ def tree_edit_commit(self): tmp_host = 'NONEED' if tmp_platform_model not in [ 'public_intents', - 'private_intents' + 'private_intents', + 'sandbox_intents' ]: if tmp_port == '': tmp_port = '0'