yobot_remix
yobot_remix copied to clipboard
连接NapCatQQ使用时,部分发送群消息功能报错ApiNotAvailable
由于性能等原因最近不得不使用NapCat作为qqbot端,发现如下问题。 *在以前gocq下,不出现以下描述的问题。
ybplugins/clan_battle/components/realize.py
中:
- 发送出刀提醒
send_remind()
群聊发送时报错,导致无法正常通过网页端提醒出刀。 - 预约提醒
subscribe_remind()
发送时报错,导致不能提醒预约。 - 下树
take_it_of_the_tree()
报错,不能提醒下树。
看了下它们都是在同步函数里用asyncio.ensure_future()调api,报错都类似于:
future: <Task finished name='Task-383' coro=<UnifiedApi.call_action() done, defined at C:\Users\Administrator\Desktop\yobot_remix\venv_for_yobot\env\lib\site-packages\aiocqhttp\api_impl.py:171> exception=ApiNotAvailable()>
Traceback (most recent call last):
File "C:\Users\Administrator\Desktop\yobot_remix\venv_for_yobot\env\lib\site-packages\aiocqhttp\api_impl.py", line 191, in call_action
raise ApiNotAvailable
aiocqhttp.exceptions.ApiNotAvailable
以为是bot端api没有完善,但这发送群消息是个基础api,经过本地测试也可以正常调用:
GET http://127.0.0.1:3000/send_group_msg?self_id=...&group_id=...&message=船新的{boss_num}王来惹~ _(:з)∠)_\n[CQ:at,qq=...]
所以不知道问题出在哪里了,求解惑