Closed jiangjiangflies closed 4 years ago
以前的老项目cqhttp可以这样用:
bot = CQHttp(api_root='http://127.0.0.1:5700') 然后直接 bot.send_group_msg(group_id=xxx,message="hi") 就可以发送消息了。
但现在提示 RuntimeWarning: coroutine 'CQHttp.call_action' was never awaited 小白一个,请大老指教!
使用
await bot.send_group_msg(group_id=xxx,message="hi")
异步方法需要在async函数内执行,或者使用同步方法
bot.sync.send_group_msg(group_id=xxx,message="hi")
以前的老项目cqhttp可以这样用:
bot = CQHttp(api_root='http://127.0.0.1:5700') 然后直接 bot.send_group_msg(group_id=xxx,message="hi") 就可以发送消息了。
但现在提示 RuntimeWarning: coroutine 'CQHttp.call_action' was never awaited 小白一个,请大老指教!