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

Commit 456d2fa

Browse files
committed
群设置类;
1 parent 9486069 commit 456d2fa

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

include/defs/group_config.hpp

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#pragma once
2+
#ifndef mirai_cpp_defs_group_config_hpp_H_
3+
#define mirai_cpp_defs_group_config_hpp_H_
4+
5+
#include <nlohmann/json.hpp>
6+
#include "serializable.hpp"
7+
8+
namespace Cyan
9+
{
10+
// ȺÉèÖÃ
11+
class GroupConfig : public Serializable
12+
{
13+
public:
14+
string Name;
15+
string Announcement;
16+
bool ConfessTalk;
17+
bool AllowMemberInvite;
18+
bool AutoApprove;
19+
bool AnonymousChat;
20+
virtual bool Set(const json& j) override
21+
{
22+
Name = j["name"].get<string>();
23+
Announcement = j["announcement"].get<string>();
24+
ConfessTalk = j["confessTalk"].get<bool>();
25+
AllowMemberInvite = j["allowMemberInvite"].get<bool>();
26+
AutoApprove = j["autoApprove"].get<bool>();
27+
AnonymousChat = j["anonymousChat"].get<bool>();
28+
return true;
29+
}
30+
virtual json ToJson() const override
31+
{
32+
json j = json::object();
33+
j["name"] = Name;
34+
j["announcement"] = Announcement;
35+
j["confessTalk"] = ConfessTalk;
36+
j["allowMemberInvite"] = AllowMemberInvite;
37+
j["autoApprove"] = AutoApprove;
38+
j["anonymousChat"] = AnonymousChat;
39+
return j;
40+
}
41+
};
42+
43+
}
44+
45+
#endif // !mirai_cpp_defs_group_config_hpp_H_

0 commit comments

Comments
 (0)