Skip to content

Commit

Permalink
Merge pull request #61 from MackerelFish/master
Browse files Browse the repository at this point in the history
兼容docker部署协议端下载replay文件(已测试napcat)
  • Loading branch information
benx1n authored Dec 1, 2024
2 parents 059b988 + 2111942 commit 5b87f7f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/plugins/hikari_bot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,15 @@ async def GROUP_FILE_listen(bot: Bot, ev: NoticeEvent):
return
if not str(ev).__contains__('.wowsreplay'):
return
if str(ev).__contains__("'url':"):
#此项兼容docker部署协议端下载replay文件,自行前往协议端配置base64
if hasattr(ev.file, 'url') and ev.file.url and ev.file.url.startswith('file://'):
base64_file = await bot.get_image(file=ev.file.id)
if not str(base64_file).__contains__("'base64':"):
await get_rep(base64_file['url'], bot, ev)
else:
# 带编码格式处理
await get_rep(base64_file['base64'], bot, ev)
elif str(ev).__contains__("'url':"):
base64_file = get_file(ev.file.url)
await get_rep(base64_file, bot, ev)
else:
Expand Down

0 comments on commit 5b87f7f

Please sign in to comment.