Closed Dongyanmio closed 1 week ago
Plugin: nonebot_plugin_obastatus
✅ 所有测试通过,一切准备就绪!
✅ 项目 nonebot-plugin-obastatus 已发布至 PyPI。 ✅ 项目 主页 返回状态码 200。 ✅ 标签: BMCLAPI-#5f82ba。 ✅ 插件类型: application。 ✅ 插件支持的适配器: nonebot.adapters.feishu, nonebot.adapters.kaiheila, nonebot.adapters.onebot.v11, nonebot.adapters.onebot.v12, nonebot.adapters.qq, nonebot.adapters.red, nonebot.adapters.telegram。 ✅ 插件 加载测试 通过。
💡 如需修改信息,请直接修改 issue,机器人会自动更新检查结果。 💡 当插件加载测试失败时,请发布新版本后在当前页面下评论任意内容以触发测试。
♻️ 评论已更新至最新检查结果
💪 Powered by NoneFlow
你的插件没有发布到github上吗
你的插件没有发布到github上吗
确定发了
你的插件没有发布到github上吗
确定发了
另外就是,我不小心将私钥填写了()
你的插件没有发布到github上吗
确定发了
哪呢
第一,你的插件可以移除onebotv11的依赖,因为你并没有依赖ob特有的api
第二,关于回复以及发图,你可以使用 alc插件或者saa插件。教程:https://nonebot.dev/docs/next/best-practice/alconna/uniseg#%E9%80%9A%E7%94%A8%E6%B6%88%E6%81%AF%E5%BA%8F%E5%88%97
示例:
from nonebot_plugin_alconna import UniMessage
...
async def _():
msg = UniMessage.image(path=xxx)
await msg.send(reply_to=True)
感谢大佬建议,已做出相关更改。
你发图那里应该用UniMessage.image(url="xxxxx")
你的scheduler执行的reload cache应该使用异步函数,httpx也应该使用异步client。你的依赖nonebot2版本应该是2.2.0
以上。
update
你的httpx依然没有使用异步方法
很抱歉打扰这么多次,遇到了点问题,在执行无参数指令时会默认将下一次发送的信息作为上一个指令的参数进行解析,我想不出如何解决,所以httpx可能要暂时搁置。
已更新
¿ 你的httpx用法完全不对啊,请参考httpx文档使用异步client AsyncClient
你应该参考这个 https://www.python-httpx.org/async/,然后改成这种感觉:
async def reload_cache():
async with httpx.AsyncClient() as client:
version = (await client.get('https://bd.bangbang93.com/openbmclapi/metric/version', headers=headers)).json()
或许真成异步了?但好像写得还是假异步?
你的代码里仍然有一处未修改 https://github.com/Zero-Octagon/nonebot-plugin-obastatus/blob/4bc9ea9e7475d316cdb1cc77c6ab37030b71804a/nonebot_plugin_obastatus/__init__.py#L355 。使用异步方式编写不会影响其他插件的并行执行。
你的代码里仍然有一处未修改 https://github.com/Zero-Octagon/nonebot-plugin-obastatus/blob/4bc9ea9e7475d316cdb1cc77c6ab37030b71804a/nonebot_plugin_obastatus/__init__.py#L355 。使用异步方式编写不会影响其他插件的并行执行。
很抱歉打扰了这么久,这次改完应该是将提出的要求解决了
PyPI 项目名
nonebot-plugin-obastatus
插件 import 包名
nonebot_plugin_obastatus
标签
[{"label":"BMCLAPI","color":"#5f82ba"}]
插件配置项