🔀 Merge pull request #509

MessageSegment.image 的 BytesIO
This commit is contained in:
Mix 2021-08-23 00:26:03 +08:00 committed by GitHub
commit 4f4a072dd7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 1 deletions

View File

@ -46,5 +46,11 @@
"desc": "TRPG骰娘, 带先攻, 查询等功能, 主要面向DND5E. 面对骰主推出的船新版本, 内置Windows/Linux详细部署指南以及方便的自定义骰娘方法, 从回复文本到查询资料库都可轻松配置~",
"author": "pear-studio",
"repo": "https://github.com/pear-studio/nonebot-dicepp"
},
{
"name": "SetuBot",
"desc": "每个群配置文件独立,可以控制频率,socks http代理,R18开关,支持多tag,自建API lolicon Pixiv热度榜",
"author": "yuban10703",
"repo": "https://github.com/yuban10703/setu-nonebot2"
}
]

View File

@ -358,5 +358,21 @@
"desc": "精细化的 NoneBot 权限管理插件",
"author": "rmuchan",
"repo": "https://github.com/rmuchan/nonebot-plugin-flexperm"
},
{
"id": "nonebot_plugin_epicfree",
"link": "nonebot_plugin_epicfree",
"name": "Epic 限免游戏资讯",
"desc": "EpicGameStore 喜加一资讯插件,发送「喜加一」逝世看吧!",
"author": "monsterxcn",
"repo": "https://github.com/monsterxcn/nonebot_plugin_epicfree"
},
{
"id": "ELF_RSS2",
"link": "ELF-RSS",
"name": "ELF_RSS",
"desc": "QQ机器人 RSS订阅 插件,订阅源建议选择 RSSHub",
"author": "Quan666",
"repo": "https://github.com/Quan666/ELF_RSS"
}
]

View File

@ -89,7 +89,7 @@ class MessageSegment(BaseMessageSegment["Message"]):
proxy: bool = True,
timeout: Optional[int] = None) -> "MessageSegment":
if isinstance(file, BytesIO):
file = file.read()
file = file.getvalue()
if isinstance(file, bytes):
file = f"base64://{b64encode(file).decode()}"
elif isinstance(file, Path):