mirai-api-http
mirai-api-http copied to clipboard
Mirai HTTP API (console) plugin
[文档](https://github.com/project-mirai/mirai-api-http/blob/70b32c13d0198bd07e7c233dfcf9552569c3360d/docs/adapter/HttpAdapter.md#%E5%93%8D%E5%BA%94-7)中展示的接口没有RESTful封装,实际上接口返回的数据是RESTful封装的,文件信息包含在`{"code":0, "msg":"", "data":xxxx}`中
例如群不存在时 `/file/list` 返回的数据是 `{"code":5,"msg":"指定对象不存在"}`,据此难以判断出错原因(#510)。如果返回 `{"code":5,"msg":"指定对象不存在:group "}` 就能一目了然。
HttpHook模式 如果延时大概10秒没有返回消息的话 再返回 机器人会没有反应
部分用于获取信息的接口返回结果没有使用RESTful封装 测试已知的接口有: 1. 获取profile的相关接口(botProfile, friendProfile, groupProfile) 2. 获取群信息接口(groupConfig) 3. 获取群成员信息接口(memberInfo) ```shell > curl 127.0.0.1:23333/botProfile?sessionKey=P3R0fGNg {"nickname":"L","email":"","age":0,"level":14,"sign":"","sex":"UNKNOWN"} > curl 127.0.0.1:23333/groupConfig?target=123456789&sessionKey=wPmJoLbv {"name":"L、C","announcement":"","confessTalk":false,"allowMemberInvite":true,"autoApprove":true,"anonymousChat":false} > curl 127.0.0.1:23333/memberInfo?target=123456789&memberId=10000000&sessionKey=wPmJoLbv {"id":10000000,"memberName":"N","specialTitle":"","permission":"OWNER","joinTimestamp":1591279073,"lastSpeakTimestamp":1629126963,"muteTimeRemaining":0,"group":{"id":123456789,"name":"L、C","permission":"ADMINISTRATOR"}} > curl 127.0.0.1:23333/about {"code":0,"msg":"","data":{"version":"2.2.0"}} ``` mah版本:V2.2.0 mirai-console版本:V2.7-RC
目前我正在自己做一个:[Wybxc/mirai-api-http-tester](https://github.com/Wybxc/mirai-api-http-tester),用的是 postman 的格式。 如果允许,我可以将其合并到这里来。 也希望大家能帮忙改进我的项目。
希望增加群头像的相关操作 如群头像变化事件,群头像修改功能等
2020-10-30 23:22:24 E/MiraiApiHttp: java.lang.IllegalStateException: Send temp message failed: MessageSvcPbSendMsg.Response.Failed(resultType=103, errorCode=0, errorMessage=发送失败,群主已禁止群成员发起临时会话) java.lang.IllegalStateException: Send temp message failed: MessageSvcPbSendMsg.Response.Failed(resultType=103, errorCode=0, errorMessage=发送失败,群主已禁止群成员发起临时会话) at net.mamoe.mirai.qqandroid.contact.MemberImpl.sendMessageImpl(MemberImpl.kt:94) at net.mamoe.mirai.qqandroid.contact.MemberImpl$sendMessageImpl$1.invokeSuspend(MemberImpl.kt) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.internal.ScopeCoroutine.afterResume(Scopes.kt:32) at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:113) at...
运行报错
[92m2022-10-15 08:47:40 I/main: Starting mirai-console...[0m[m [92m2022-10-15 08:47:40 I/main: Backend: version 2.12.1, built on 2022-07-31 09:49:27.[0m[m [92m2022-10-15 08:47:40 I/main: Frontend Terminal: version 2.12.1, provided by Mamoe Technologies[0m[m [92m2022-10-15 08:47:40 I/main: Welcome...
如题 使用 logout 下线账号后 再用 login 登陆任何一个账号,即使和之前一样,ws也收不到任何消息除非重启mirai,ws没掉重连也不收不到任何消息,其他协议没测
main.cpp: ```cpp #include #include #define CA_CERT_FILE "./ca-bundle.crt" using namespace std; int main() { #ifdef CPPHTTPLIB_OPENSSL_SUPPORT httplib::SSLClient cli("localhost", 8080); cli.set_ca_cert_path(CA_CERT_FILE); cli.enable_server_certificate_verification(true); #else httplib::Client cli("localhost", 8080); #endif auto res = cli.Get("/"); while...