nonebot / adapter-satori

NoneBot2 Satori 适配器 / Satori Protocol adapter for nonebot2
MIT License
84 stars 5 forks source link

[Feature] satori是否不支持发送群组消息,能否支持该功能 #21

Closed AhBumm closed 6 months ago

AhBumm commented 6 months ago

请确认:

Feature

概要

发送群组消息

是否已有相关实现

暂无

其他内容

(nonebot_env) lmx@3500x:~/blive_push$ nb run --reload
Started reloader with process [1608766].
05-18 17:34:09 [SUCCESS] nonebot | NoneBot is initializing...
05-18 17:34:09 [INFO] nonebot | Current Env: prod
05-18 17:34:10 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_apscheduler"
05-18 17:34:10 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_localstore"
05-18 17:34:10 [INFO] nonebot-plugin-bilibili-notifier | 加载上次更新时间2024-05-18 17:26:36(1716053196)
05-18 17:34:10 [INFO] nonebot-plugin-bilibili-notifier | 推送更新消息的用户:群:
05-18 17:34:10 [INFO] nonebot-plugin-bilibili-notifier | 推送直播消息的用户:群:
05-18 17:34:10 [INFO] nonebot-plugin-bilibili-notifier | 屏蔽的消息/群:{}
05-18 17:34:10 [SUCCESS] nonebot | Succeeded to load plugin "config" from "nonebot-plugin-bilibili-notifier.nonebot_plugin_bilibili_notifier.config"
05-18 17:34:10 [SUCCESS] nonebot | Running NoneBot...
05-18 17:34:10 [INFO] uvicorn | Started server process [1608766]
05-18 17:34:10 [INFO] uvicorn | Waiting for application startup.
05-18 17:34:10 [INFO] nonebot_plugin_apscheduler | Scheduler Started
05-18 17:34:10 [INFO] uvicorn | Application startup complete.
05-18 17:34:10 [INFO] uvicorn | Uvicorn running on http://127.0.0.1:8080 (Press CTRL+C to quit)
05-18 17:34:10 [INFO] nonebot | Satori | Bot 1021009873 connected

05-18 17:35:00 [INFO] nonebot-plugin-bilibili-notifier | 将3546377921497768的更新推送到123456789
****** 发布动态:test
https://www.bilibili.com/opus/
05-18 17:35:00 [ERROR] apscheduler | Job "fetch_bilibili_updates (trigger: cron[second='0'], next run at: 2024-05-19 01:36:00 CST)" raised an exception
Traceback (most recent call last):
  File "<string>", line 15, in <module>
  File "/home/lmx/nonebot_env/lib/python3.10/site-packages/nonebot/__init__.py", line 335, in run
    get_driver().run(*args, **kwargs)
  File "/home/lmx/nonebot_env/lib/python3.10/site-packages/nonebot/drivers/fastapi.py", line 186, in run
    uvicorn.run(
  File "/home/lmx/nonebot_env/lib/python3.10/site-packages/uvicorn/main.py", line 575, in run
    server.run()
  File "/home/lmx/nonebot_env/lib/python3.10/site-packages/uvicorn/server.py", line 65, in run
    return asyncio.run(self.serve(sockets=sockets))
  File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
> File "/home/lmx/nonebot_env/lib/python3.10/site-packages/apscheduler/executors/base_py3.py", line 30, in run_coroutine_job
    retval = await job.func(*job.args, **job.kwargs)
  File "/home/lmx/blive_push/nonebot-plugin-bilibili-notifier/nonebot_plugin_bilibili_notifier/__init__.py", line 162, in fetch_bilibili_updates
    await bot.send_group_msg(guild_id=gid, message=msg)
  File "/home/lmx/nonebot_env/lib/python3.10/site-packages/nonebot/adapters/satori/bot.py", line 163, in __getattr__
    raise AttributeError(f"'Bot' object has no attribute '{item}'")
AttributeError: 'Bot' object has no attribute 'send_group_msg'
RF-Tar-Railt commented 6 months ago

这个插件是否是你自己的?

如果是,请注意一点,每个bot只有.send方法是通用的,其余方法都是适配器特有的。你这里使用的bot.send_group_msg很明显不是satori接口。 解决方案:要么你自己做多适配器适配(根据不同适配器调用不同bot的方法),要么请使用nonebot现有的跨平台组件(plugin-alconna或plugin-send-anything-anywhere)

如果不是,请将上述内容转发给插件作者。如果插件作者不再维护,请通知他要么把插件下架,要么转交给noneplugin-renew组织

AhBumm commented 6 months ago

这个插件是否是你自己的?

如果是,请注意一点,每个bot只有.send方法是通用的,其余方法都是适配器特有的。你这里使用的bot.send_group_msg很明显不是satori接口。 解决方案:要么你自己做多适配器适配(根据不同适配器调用不同bot的方法),要么请使用nonebot现有的跨平台组件(plugin-alconna或plugin-send-anything-anywhere)

如果不是,请将上述内容转发给插件作者。如果插件作者不再维护,请通知他要么把插件下架,要么转交给noneplugin-renew组织

与插件作者讨论后通过plugin-send-anything-anywhere组件已解决问题,感谢回复