nonebot / aiocqhttp

A Python SDK with async I/O for CQHTTP (OneBot).
https://aiocqhttp.nonebot.dev
MIT License
280 stars 39 forks source link

ApiNotAvailable 错误 #10

Closed Wybxc closed 5 years ago

Wybxc commented 5 years ago
@bot.on_message('private')
async def handle_msg_private(context):
    await bot.send_msg(message='Hello,World!', message_type='private', user_id=context['user_id'])

使用反向Websocket,如果用bot.send发送消息就没有问题。

stdrc commented 5 years ago

你应该需要升级一下 aiocqhttp 的版本,在某个版本之前,使用反向 WS 的情况下,调用接口是必须传入 self_id 参数的(即使只有一个连接)

Wybxc commented 5 years ago

谢谢,问题已经解决了。