在发送20kb的图片时报错图片过大 #1393
-
运行环境:
问题描述我想通过私聊发送图片,但是发现无论是使用url发送还是下载到本地再发送,都会报错如下:
相关代码如下: imgSend = on_command("imgSend", rule=to_me, aliases={"发图", "图片测试"})
@imgSend.handle()
async def AddBiliVideoFollow(matcher: Matcher, args: Message = CommandArg()):
imgPath = '/root/project/NoneBot/TDK_Bot/src/file/biliStream/covers/haya.jpg'
imgURI = pathlib.Path(imgPath).as_uri()
size = os.path.getsize(imgPath) / 1024
textMsg = '图片大小: {} kb'.format(size)
reportedMsg = Message([
MessageSegment(type='text', data={'text':textMsg}),
MessageSegment(type='image', data={'url':imgURI})
])
await imgSend.finish(reportedMsg) 请问我该如何解决这个问题,诚心求助QAQ |
Beta Was this translation helpful? Give feedback.
Answered by
qianjunakasumi
Mar 5, 2022
Replies: 1 comment 1 reply
-
请尝试直接使用 go-cqhttp 相关接口复现, |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
TDK1969
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
请尝试直接使用 go-cqhttp 相关接口复现,
若问题重现,请前往 Issues 中提交相关 BUG 说明
若问题无法得到复现(发送成功),请检查\咨询您基于 go-cqhttp 的框架有关方