Closed dbxxx-ac closed 3 years ago
哦对了,补充一条:我已经安装且正确配置了mirai-http-api插件。
/**
* \brief MiraiBot的另一个构造函数
* \param host hostname
* \param port port
*/
MiraiBot(const string& host, int port);
不知道你有没有修改默认的端口,如果修改了,实例化MiraiBot对象的时候是需要设置的。 比如:
MiraiBot bot("localhost",8889);
如果不指定(MiraiBot bot;
),host和port的默认值是"localhost"
和8080
如果是连接的远程服务器,试一下用浏览器访问 http://hostname:port/about
(例如 http://baidu.com:1234/about
),检查能不能正确返回 mirai-api-http 的版本信息。
/** * \brief MiraiBot的另一个构造函数 * \param host hostname * \param port port */ MiraiBot(const string& host, int port);
不知道你有没有修改默认的端口,如果修改了,实例化MiraiBot对象的时候是需要设置的。 比如:
MiraiBot bot("localhost",8889);
如果不指定(
MiraiBot bot;
),host和port的默认值是"localhost"
和8080
如果是连接的远程服务器,试一下用浏览器访问
http://hostname:port/about
(例如http://baidu.com:1234/about
),检查能不能正确返回 mirai-api-http 的版本信息。
感谢回复!
并没有修改默认的端口,连接的也不是远程服务器。
/** * \brief MiraiBot的另一个构造函数 * \param host hostname * \param port port */ MiraiBot(const string& host, int port);
不知道你有没有修改默认的端口,如果修改了,实例化MiraiBot对象的时候是需要设置的。 比如:
MiraiBot bot("localhost",8889);
如果不指定(
MiraiBot bot;
),host和port的默认值是"localhost"
和8080
如果是连接的远程服务器,试一下用浏览器访问http://hostname:port/about
(例如http://baidu.com:1234/about
),检查能不能正确返回 mirai-api-http 的版本信息。感谢回复!
并没有修改默认的端口,连接的也不是远程服务器。
那使用浏览器访问 http://127.0.0.1:8080/about
是否能获取到 mirai-api-http 的版本信息。
问题解决了……qwq
重装了一下mirai-cpp-template,问题得到了解决。
保证Authkey是正确的,QQ号也是正确的,mirai-console也在正常运行,可是依旧抛出“网络错误”的异常。保证网络没有问题。
请问是怎么回事呢?