diff --git a/.github/publish.txt b/.github/publish.txt index 42a5528a..d0ca9ece 100644 --- a/.github/publish.txt +++ b/.github/publish.txt @@ -1 +1 @@ -v6.5.2 +v6.5.3 diff --git a/core/__init__.py b/core/__init__.py index 026bda32..13154155 100644 --- a/core/__init__.py +++ b/core/__init__.py @@ -33,16 +33,6 @@ message_record = [] -class SourceServer(ChainBuilder): - @classmethod - async def get_image(cls, image): - if type(image) is bytes: - res = await http_requests.post_upload(f'{remote_config.remote.resource}/upload', image) - if res: - return remote_config.remote.resource + '/' + res.strip('"') - return image - - def set_prefix(): bot.set_prefix_keywords([*prefix_conf.prefix_keywords]) @@ -61,17 +51,13 @@ async def send_to_console_channel(chain: Chain): instance = bot[item.appid] if item.console_channel and instance: - if isinstance(instance.instance, QQGuildBotInstance): - if not instance.private: - chain.builder = SourceServer() - await instance.send_message(chain, channel_id=item.console_channel) async def heartbeat(): for item in bot: await http_requests.get( - f'{config.remote_config.remote.plugin}/heartbeat?appid={item.appid}', + f'{remote_config.remote.plugin}/heartbeat?appid={item.appid}', ignore_error=True, ) diff --git a/core/config/remote.py b/core/config/remote.py index f320c053..c7fe25d6 100644 --- a/core/config/remote.py +++ b/core/config/remote.py @@ -7,7 +7,6 @@ class Remote: cos: str = 'https://cos.amiyabot.com' plugin: str = 'https://server.amiyabot.com:10001' console: str = 'http://106.52.139.57:8000' - resource: str = '' @dataclass diff --git a/core/database/bot.py b/core/database/bot.py index b95b49af..1f0b0738 100644 --- a/core/database/bot.py +++ b/core/database/bot.py @@ -48,6 +48,7 @@ class BotAccounts(BotBaseModel): http_port: int = IntegerField(null=True) client_secret: str = CharField(null=True) + sandbox: int = SmallIntegerField(default=0) shard_index: int = SmallIntegerField(default=0) shards: int = SmallIntegerField(default=1) @@ -100,7 +101,7 @@ def build_conf(cls, item): 'shards': item.shards, } if item.adapter == 'qq_guild': - conf['adapter'] = adapter(**shards) + conf['adapter'] = adapter(**shards, sandbox=bool(item.sandbox)) else: opt = QQGroupChainBuilderOptions( item.host or '0.0.0.0', item.http_port or 8086, './resource/group_temp' diff --git a/core/server/bot.py b/core/server/bot.py index e8fbc35e..5171877b 100644 --- a/core/server/bot.py +++ b/core/server/bot.py @@ -24,6 +24,7 @@ class BotAccountModel(BotAppId): http_port: Optional[int] = None client_secret: Optional[str] = None + sandbox: int = 0 shard_index: int = 0 shards: int = 1 diff --git a/pluginsDev b/pluginsDev index e9886e36..65ccaaca 160000 --- a/pluginsDev +++ b/pluginsDev @@ -1 +1 @@ -Subproject commit e9886e36ba10a84de15bd8632c81161fa228f4a7 +Subproject commit 65ccaaca88267b31f49c3c1094b67b652887b929 diff --git a/requirements.txt b/requirements.txt index 5dd80d17..052c29b5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -amiyabot==2.0.1 +amiyabot==2.0.2 attrdict~=2.0.1 baidu-aip dhash~=1.3