用server-satori
插件提供的api主动发消息到飞书平台,文本一直没问题,但图片发不了,单发一个图片元素得到的返回是 []
,图文混合就只有文字
所以想请教是有什么没考虑到的配置或是什么?
环境相关:
System:
OS: Windows 10 10.0.19045
CPU: (8) x64 Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz
Binaries:
Node: 20.3.1
Yarn: 4.0.1
Koishi:
Core: 4.16.3
Console: 5.22.6
Koishi Desktop: 1.0.1
相关插件:
server: 3.1.3
server-satori: 2.4.0
adapter-lark: 3.2.1
用其它插件测试bot有发送图片权限:(测试插件为beauty-huluxia
)
调用api发送的结果:
调用pythonsdk发送的结果:
satori-python-client 0.9.2
satori-python-core 0.9.2
import os.path
from satori import WebsocketsInfo, LoginStatus, Image, Message
from satori.client import Account, App
app = App(WebsocketsInfo(host="127.0.0.1", port=5140, path="satori"))
@app.lifecycle
async def record(account: Account, state):
if state == LoginStatus.CONNECT:
# print(await account.guild_get(guild_id="oc_e22b351fb1d43962119f69701388c0a8"))
print(os.path.exists("C:/Users/Lyc/Downloads/favicon.png"))
img = Image.of(path="C:/Users/Lyc/Downloads/favicon.png")
message = Message(content=[img])
print(await account.session.send_message(channel="oc_e22b351fb1d43962119f69701388c0a8", message=[message]))
app.run()