Skip to content

Commit

Permalink
Merge pull request #281 from AmiyaBot/V6-dev
Browse files Browse the repository at this point in the history
update 修复bug
  • Loading branch information
vivien8261 authored Aug 8, 2024
2 parents eb9a656 + b86f68f commit 91945ca
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/publish.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v6.5.2
v6.5.3
16 changes: 1 addition & 15 deletions core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])

Expand All @@ -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,
)

Expand Down
1 change: 0 additions & 1 deletion core/config/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion core/database/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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'
Expand Down
1 change: 1 addition & 0 deletions core/server/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
amiyabot==2.0.1
amiyabot==2.0.2
attrdict~=2.0.1
baidu-aip
dhash~=1.3
Expand Down

0 comments on commit 91945ca

Please sign in to comment.