Skip to content
This repository was archived by the owner on Aug 16, 2024. It is now read-only.

Commit ea26c3d

Browse files
committed
更新文档;
1 parent 80713a5 commit ea26c3d

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@
2020

2121
## 项目文档
2222

23+
> 项目文档没有详细介绍各 API 函数的用法,mirai_bot.hpp 中的注释已经比较详细,如有疑惑,建议浏览。
24+
2325
项目文档: [使用说明](doc/使用说明.md)
2426

2527
对于刚入门的 C++ 用户,推荐使用 [mirai-cpp-template](https://github.com/cyanray/mirai-cpp-template) 这个模板项目来降低使用难度。
2628

27-
因为文档不够全面,推荐阅读各个 examples 。阅读完 examples 后,应该就可以按照“直觉”来使用 mirai-cpp 了
29+
推荐阅读 examples 目录下的示例
2830

2931
| 文件名 | 说明 |
3032
|----------------------|------------------------------|
@@ -41,6 +43,9 @@
4143
| RecallEvent.cpp | 处理其他人撤回消息的事件 |
4244
| Mute.cpp | 和禁言有关的操作 |
4345
| RichMessage.cpp | 发送 JSON、闪照等类型的消息 |
46+
| CompareMessage.cpp | 对比 MessageChain 是否相同 |
47+
| FetchEventsViaHTTP.cpp| 设置通过 HTTP 短轮询获取事件和消息 |
48+
| GroupMemberInfo.cpp | 获取/设置群成员的群名片与群头衔 |
4449

4550
## 如何使用
4651

doc/使用说明.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,10 @@ bot.On<NewFriendRequestEvent>([&](NewFriendRequestEvent e)
115115
bot.EventLoop();
116116
```
117117

118-
mirai-cpp 默认使用 WebSocket 拉取事件和消息,如果需要通过 HTTP 来拉取消息,可以调用 UseHTTP 函数。(不需要开启 mirai-api-http 的全局 WebSocket 设置,mirai-cpp 会自动针对 Session 开启 WebSocket。)
118+
mirai-cpp 默认使用 WebSocket 拉取事件和消息,如果需要通过 HTTP 来拉取消息,可以调用 UseHttp 函数。(不需要开启 mirai-api-http 的全局 WebSocket 设置,mirai-cpp 会自动针对 Session 开启 WebSocket。)
119119

120120
```C++
121-
bot.UseHTTP().EventLoop();
121+
bot.UseHttp().EventLoop();
122122
```
123123

124124
推荐使用 WebSocket, 使用 WebSocket 比 HTTP 效率更高。
@@ -239,10 +239,10 @@ MessageChain 提供了 GetXXX 的方法,其中 XXX 为消息类型,作用是
239239

240240
| 方法签名 | 说明 |
241241
|-------------------------------------|-------------------------------------------------|
242-
| vector<string> GetPlain() const | 获取所有 Plain 类型消息 |
243-
| vector<MiraiImage> GetImage() const | 获取所有 Image、FlashImage 类型消息(图片和闪照) |
244-
| vector<QQ_t> GetAt() const | 获取所有 At 类型消息 |
245-
| vector<int> GetFace() const | 获取所有 Face 类型消息 |
242+
| vector< string > GetPlain() const | 获取所有 Plain 类型消息 |
243+
|vector< MiraiImage > GetImage() const| 获取所有 Image、FlashImage 类型消息(图片和闪照) |
244+
| vector< QQ_t > GetAt() const | 获取所有 At 类型消息 |
245+
| vector< int > GetFace() const | 获取所有 Face 类型消息 |
246246

247247
## 其他函数
248248

@@ -271,6 +271,9 @@ GetTimestamp 方法可以获得这条消息的时间戳(类型为 int64_t )。
271271
| RecallEvent.cpp | 处理其他人撤回消息的事件 |
272272
| Mute.cpp | 和禁言有关的操作 |
273273
| RichMessage.cpp | 发送 JSON、闪照等类型的消息 |
274+
| CompareMessage.cpp | 对比 MessageChain 是否相同 |
275+
| FetchEventsViaHTTP.cpp| 设置通过 HTTP 短轮询获取事件和消息 |
276+
| GroupMemberInfo.cpp | 获取/设置群成员的群名片与群头衔 |
274277

275278

276279
# 关于异常

0 commit comments

Comments
 (0)