Skip to content

Commit 91945ca

Browse files
authored
Merge pull request #281 from AmiyaBot/V6-dev
update 修复bug
2 parents eb9a656 + b86f68f commit 91945ca

File tree

7 files changed

+7
-20
lines changed

7 files changed

+7
-20
lines changed

.github/publish.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v6.5.2
1+
v6.5.3

core/__init__.py

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,6 @@
3333
message_record = []
3434

3535

36-
class SourceServer(ChainBuilder):
37-
@classmethod
38-
async def get_image(cls, image):
39-
if type(image) is bytes:
40-
res = await http_requests.post_upload(f'{remote_config.remote.resource}/upload', image)
41-
if res:
42-
return remote_config.remote.resource + '/' + res.strip('"')
43-
return image
44-
45-
4636
def set_prefix():
4737
bot.set_prefix_keywords([*prefix_conf.prefix_keywords])
4838

@@ -61,17 +51,13 @@ async def send_to_console_channel(chain: Chain):
6151
instance = bot[item.appid]
6252

6353
if item.console_channel and instance:
64-
if isinstance(instance.instance, QQGuildBotInstance):
65-
if not instance.private:
66-
chain.builder = SourceServer()
67-
6854
await instance.send_message(chain, channel_id=item.console_channel)
6955

7056

7157
async def heartbeat():
7258
for item in bot:
7359
await http_requests.get(
74-
f'{config.remote_config.remote.plugin}/heartbeat?appid={item.appid}',
60+
f'{remote_config.remote.plugin}/heartbeat?appid={item.appid}',
7561
ignore_error=True,
7662
)
7763

core/config/remote.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ class Remote:
77
cos: str = 'https://cos.amiyabot.com'
88
plugin: str = 'https://server.amiyabot.com:10001'
99
console: str = 'http://106.52.139.57:8000'
10-
resource: str = ''
1110

1211

1312
@dataclass

core/database/bot.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ class BotAccounts(BotBaseModel):
4848
http_port: int = IntegerField(null=True)
4949
client_secret: str = CharField(null=True)
5050

51+
sandbox: int = SmallIntegerField(default=0)
5152
shard_index: int = SmallIntegerField(default=0)
5253
shards: int = SmallIntegerField(default=1)
5354

@@ -100,7 +101,7 @@ def build_conf(cls, item):
100101
'shards': item.shards,
101102
}
102103
if item.adapter == 'qq_guild':
103-
conf['adapter'] = adapter(**shards)
104+
conf['adapter'] = adapter(**shards, sandbox=bool(item.sandbox))
104105
else:
105106
opt = QQGroupChainBuilderOptions(
106107
item.host or '0.0.0.0', item.http_port or 8086, './resource/group_temp'

core/server/bot.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class BotAccountModel(BotAppId):
2424
http_port: Optional[int] = None
2525
client_secret: Optional[str] = None
2626

27+
sandbox: int = 0
2728
shard_index: int = 0
2829
shards: int = 1
2930

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
amiyabot==2.0.1
1+
amiyabot==2.0.2
22
attrdict~=2.0.1
33
baidu-aip
44
dhash~=1.3

0 commit comments

Comments
 (0)