This repository has been archived by the owner on Nov 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Former-commit-id: f0a29ac
- Loading branch information
Showing
34 changed files
with
260 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
eb4bdcffbb4edf2d9af251b2aecbded57f4d14b1 | ||
606927228cb056176d8a2e1a791251ed63c8c4f7 |
2 changes: 1 addition & 1 deletion
2
mirai-demo/.vs/mirai-demo/v16/ipch/c06e1943f8bf3a14.ipch.REMOVED.git-id
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
eee644334b70921027d186bd936589a8ff6239b5 | ||
ee62910962d5c8242b1f44d7cda78d9f66f21010 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<ClassDiagram /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,42 @@ | ||
#include "pch.h" | ||
class procession: public Procession{ | ||
//Ö÷Òª´¦ÀíλÖà | ||
public: | ||
void GroupMessage(Group g, Friend f, string message) { | ||
g.SendMsg(message); | ||
logger.Info(message); | ||
} | ||
void PrivateMessage(Friend f, string message) { | ||
f.SendMsg(message); | ||
} | ||
string GroupInvite(Group g, Friend f) { | ||
return accept; | ||
} | ||
string NewFrinedRequest(Friend f, string message) { | ||
return accept; | ||
} | ||
}; | ||
void EventRegister() { | ||
/* | ||
注册事件监听-用户自定义 | ||
logger - 日志组件 | ||
logger.Info(string)发送消息级日志 | ||
logger.Warning(string)发送警告级日志 | ||
logger.Error(string)发送错误级日志 | ||
procession 广播源 | ||
procession.registerEvent(lambda) 开始监听事件,可以重复监听 | ||
procession.registerEvent([](GroupMessageEvent param){ \*处理*\});是监听群消息 | ||
procession.registerEvent([](PrivateMessageEvent param){ \*处理*\});是监听群消息 | ||
... | ||
参数都在param变量里,在lambda块中使用param.xxx来调用 | ||
*/ | ||
|
||
procession.registerEvent([](GroupMessageEvent param)->void { | ||
//在这写你自己处理群消息的代码 | ||
logger.Info("hi"); | ||
param.group.SendMsg("hi"); | ||
}); | ||
procession.registerEvent([](PrivateMessageEvent param)->void { | ||
//在这写你自己处理私聊消息的代码 | ||
logger.Info("hi"); | ||
param.sender.SendMsg("hi"); | ||
}); | ||
procession.registerEvent([](GroupInviteEvent param)->bool{ | ||
//处理群邀请,true同意进群,false不同意 | ||
if (param.sender.id == 11111) { | ||
return true; | ||
} | ||
return true; | ||
}); | ||
procession.registerEvent([](NewFriendRequestEvent param)->bool { | ||
//新好友邀请 | ||
logger.Info("新好友申请来自于" + to_string(param.sender.id)); | ||
if (param.message == "hhh") { | ||
return false; | ||
} | ||
return true; | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,5 +44,6 @@ | |
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="cpp.hint" /> | ||
<None Include="ClassDiagram.cd" /> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.