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

Commit 5bbc63f

Browse files
committed
MessageChain新增GetPlain方法;
1 parent d846164 commit 5bbc63f

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

include/defs/message_chain.hpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,18 @@ namespace Cyan
196196
}
197197
return string();
198198
}
199-
199+
vector<string> GetPlain() const
200+
{
201+
vector<string> res;
202+
for (const auto& ele : messages_)
203+
{
204+
if (ele["type"].get<string>() == "Plain")
205+
{
206+
res.emplace_back(ele["text"].get<string>());
207+
}
208+
}
209+
return res;
210+
}
200211
vector<MiraiImage> GetImage() const
201212
{
202213
vector<MiraiImage> res;

0 commit comments

Comments
 (0)