From f87bf91ae8448d94c3b9ff8a601674f6597e4c71 Mon Sep 17 00:00:00 2001 From: Vivien <34387011+vivien8261@users.noreply.github.com> Date: Fri, 2 Aug 2024 10:06:00 +0800 Subject: [PATCH] =?UTF-8?q?update:=20=E6=9B=B4=E6=96=B0=E9=A2=91=E9=81=93?= =?UTF-8?q?=E9=80=82=E9=85=8D=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- amiyabot/adapters/tencent/qqGroup/builder.py | 2 +- amiyabot/adapters/tencent/qqGuild/__init__.py | 4 +++- amiyabot/builtin/messageChain/element.py | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/amiyabot/adapters/tencent/qqGroup/builder.py b/amiyabot/adapters/tencent/qqGroup/builder.py index ffa4ece..ff7dbc9 100644 --- a/amiyabot/adapters/tencent/qqGroup/builder.py +++ b/amiyabot/adapters/tencent/qqGroup/builder.py @@ -3,7 +3,7 @@ from graiax import silkcoder from contextlib import contextmanager -from dataclasses import asdict, field +from dataclasses import dataclass, asdict, field from amiyabot.util import create_dir, get_public_ip, random_code from amiyabot.adapters import MessageCallback from amiyabot.network.httpServer import HttpServer diff --git a/amiyabot/adapters/tencent/qqGuild/__init__.py b/amiyabot/adapters/tencent/qqGuild/__init__.py index 93a5423..380c059 100644 --- a/amiyabot/adapters/tencent/qqGuild/__init__.py +++ b/amiyabot/adapters/tencent/qqGuild/__init__.py @@ -16,8 +16,10 @@ from .builder import build_message_send, QQGuildMessageCallback -def qq_guild_shards(shard_index: int, shards: int): +def qq_guild_shards(shard_index: int, shards: int, sandbox: bool = False): def adapter(appid: str, token: str): + if sandbox: + return QQGuildSandboxBotInstance(appid, token, shard_index, shards) return QQGuildBotInstance(appid, token, shard_index, shards) return adapter diff --git a/amiyabot/builtin/messageChain/element.py b/amiyabot/builtin/messageChain/element.py index 5faa602..659bc05 100644 --- a/amiyabot/builtin/messageChain/element.py +++ b/amiyabot/builtin/messageChain/element.py @@ -1,8 +1,8 @@ import os import json -from dataclasses import dataclass from typing import List, Any +from dataclasses import dataclass from amiyabot.builtin.lib.browserService import * from amiyabot import log