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

Commit d846164

Browse files
committed
Message新增GetAt;
Message修改Get接口名称;
1 parent 6da339d commit d846164

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

include/defs/message_chain.hpp

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ namespace Cyan
172172
return *this;
173173
}
174174

175-
string GetPlainTextAll() const
175+
string GetPlainText() const
176176
{
177177
using std::stringstream;
178178
stringstream ss;
@@ -197,7 +197,7 @@ namespace Cyan
197197
return string();
198198
}
199199

200-
vector<MiraiImage> GetImageAll() const
200+
vector<MiraiImage> GetImage() const
201201
{
202202
vector<MiraiImage> res;
203203
for (const auto& ele : messages_)
@@ -216,6 +216,21 @@ namespace Cyan
216216
return res;
217217
}
218218

219+
vector<QQ_t> GetAt()
220+
{
221+
vector<QQ_t> res;
222+
for (const auto& ele : messages_)
223+
{
224+
string type_name = ele["type"].get<string>();
225+
if (type_name == "At")
226+
{
227+
QQ_t qq = (QQ_t)(ele["target"].get<int64_t>());
228+
res.emplace_back(qq);
229+
}
230+
}
231+
return res;
232+
}
233+
219234
MessageId GetMessageId() const
220235
{
221236
return messageId_;

0 commit comments

Comments
 (0)