This repository was archived by the owner on Aug 16, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed
Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change 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_
You can’t perform that action at this time.
0 commit comments