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

Commit 0c4cb39

Browse files
authored
Merge pull request #98 from cyanray/dev/cyanray
重构 MiraiBot 等
2 parents 81f059a + f319cf6 commit 0c4cb39

File tree

6 files changed

+137
-398
lines changed

6 files changed

+137
-398
lines changed

include/mirai/defs/group.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace Cyan
1515
public:
1616
GID_t GID;
1717
string Name;
18-
GroupPermission Permission;
18+
GroupPermission Permission = GroupPermission::Member;
1919
virtual bool Set(const json& j) override
2020
{
2121
GID = GID_t(j["id"].get<int64_t>());

include/mirai/defs/group_config.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ namespace Cyan
1313
public:
1414
string Name;
1515
string Announcement;
16-
bool ConfessTalk;
17-
bool AllowMemberInvite;
18-
bool AutoApprove;
19-
bool AnonymousChat;
16+
bool ConfessTalk = false;
17+
bool AllowMemberInvite = false;
18+
bool AutoApprove = false;
19+
bool AnonymousChat = false;
2020
virtual bool Set(const json& j) override
2121
{
2222
Name = j["name"].get<string>();

include/mirai/defs/group_member.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace Cyan
1616
public:
1717
QQ_t QQ;
1818
string MemberName;
19-
GroupPermission Permission;
19+
GroupPermission Permission = GroupPermission::Member;
2020
Group_t Group;
2121
virtual bool Set(const json& j) override
2222
{
@@ -35,9 +35,7 @@ namespace Cyan
3535
j["group"] = Group.ToJson();
3636
return j;
3737
}
38-
3938
};
40-
4139
}
4240

4341
#endif // !mirai_cpp_defs_group_member_hpp_H_

include/mirai/defs/qq_types.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ namespace Cyan
136136
{
137137
string Id;
138138
string FileName;
139-
size_t FileSize;
139+
size_t FileSize = 0;
140140
int InternalId = 102;
141141
};
142142

include/mirai/mirai_bot.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -337,9 +337,9 @@ namespace Cyan
337337
* @param helpMessage 指令帮助,执行出错时显示
338338
* @return *this
339339
*/
340-
MiraiBot& RegisterCommand(
340+
void RegisterCommand(
341341
const string& commandName,
342-
const vector<string> alias,
342+
const vector<string>& alias,
343343
const string& description,
344344
const string& helpMessage = "");
345345

@@ -349,7 +349,7 @@ namespace Cyan
349349
* @param args 参数
350350
* @return *this
351351
*/
352-
MiraiBot& SendCommand(const string& commandName, const vector<string> args);
352+
void SendCommand(const string& commandName, const vector<string>& args);
353353

354354
/**
355355
* @brief 获得 Managers

0 commit comments

Comments
 (0)