Skip to content

Commit

Permalink
修改主方法为异步,修改私聊时GroupUin为SenderUin
Browse files Browse the repository at this point in the history
  • Loading branch information
KusaGumina committed Oct 21, 2023
1 parent 609dcdf commit 31d33d1
Show file tree
Hide file tree
Showing 17 changed files with 16 additions and 17 deletions.
8 changes: 3 additions & 5 deletions RedProtocolSharp.Sample/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,18 @@ public class Sample
{
public static async Task Main()
{
var bot = new Bot("localhost:16530", "650ab2f2e5aa80ff890a2bd66c021bb7518cb0077d15f1f6a8890de3800329dd");
var bot = new Bot("localhost:16531", "650ab2f2e5aa80ff890a2bd66c021bb7518cb0077d15f1f6a8890de3800329dd");
bot.Logger.BotLog.OnLogger += BotLogOnHandler;
bot.Invoker.OnGroupMessageReceived += InvokerOnOnGroupMessageReceived;
bot.Invoker.OnPrivateMessageReceived += InvokerOnOnPrivateMessageReceived;
bot.Invoker.OnGroupMemberAdd += InvokerOnOnGroupMemberAdd;
bot.Start();
var reply = await
bot.Send
.SetTarget("1919810", ChatTypes.GroupMessage)
.SetTarget("761889645", ChatTypes.GroupMessage)
.AddText("testMessage")
.AddAt("114514")
.AddPic("test.png")
.AddAt("1806552019")
.SendMessage();
await bot.Action.Revoke(new []{reply.msgId}, reply.chatTypes, reply.peerUin);
while (true)
{
}
Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion RedProtocolSharp/Bot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public Bot(string url,string authorizationToken)
public BotGet Get;
public BotAction Action;
public Events Invoker;
public async void Start()
public async Task Start()
{

//连接
Expand Down
3 changes: 2 additions & 1 deletion RedProtocolSharp/Invoker/EventInvoker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ internal bool OnPrivateMessageReceivedTriggered(MsgType.Payload<MsgType.MessageR
MsgId = senderInfo.MsgId,
MsgSeq = senderInfo.ReplayMsgSeq,
Time = senderInfo.Time,
SenderUin = senderInfo.Uin
SenderUin = senderInfo.Uin,
GroupUin = senderInfo.Uin
};
chain.Parse(originPayload);
if (chain.Count == 0)
Expand Down
4 changes: 2 additions & 2 deletions RedProtocolSharp/RedProtocolSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
<Authors>KusaGumina</Authors>
<RepositoryUrl>https://github.com/KusaGumina/RedProtocolSharp</RepositoryUrl>
<RepositoryType>GitHub</RepositoryType>
<PackageReleaseNotes>新增撤回,完善发送消息的返回,修复Bug</PackageReleaseNotes>
<PackageReleaseNotes>修改主方法为异步,修改私聊时GroupUin为SenderUin</PackageReleaseNotes>
<Configurations>Release</Configurations>
<Platforms>AnyCPU</Platforms>
<Version>0.0.2</Version>
<Version>0.0.3</Version>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageLicenseUrl>https://www.gnu.org/licenses/agpl-3.0.en.html#license-text</PackageLicenseUrl>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v7.0": {
"RedProtocolSharp/0.0.2": {
"RedProtocolSharp/0.0.3": {
"dependencies": {
"Newtonsoft.Json": "13.0.3",
"WebSocketSharp": "1.0.3-rc11"
Expand Down Expand Up @@ -34,7 +34,7 @@
}
},
"libraries": {
"RedProtocolSharp/0.0.2": {
"RedProtocolSharp/0.0.3": {
"type": "project",
"serviceable": false,
"sha512": ""
Expand Down
Binary file modified RedProtocolSharp/bin/Release/net7.0/RedProtocolSharp.dll
Binary file not shown.
Binary file modified RedProtocolSharp/bin/Release/net7.0/RedProtocolSharp.pdb
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v7.0": {
"RedProtocolSharp/0.0.2": {
"RedProtocolSharp/0.0.3": {
"dependencies": {
"Newtonsoft.Json": "13.0.3",
"WebSocketSharp": "1.0.3-rc11"
Expand Down Expand Up @@ -34,7 +34,7 @@
}
},
"libraries": {
"RedProtocolSharp/0.0.2": {
"RedProtocolSharp/0.0.3": {
"type": "project",
"serviceable": false,
"sha512": ""
Expand Down
Binary file modified RedProtocolSharp/bin/Release/net7.0/publish/RedProtocolSharp.dll
Binary file not shown.
Binary file modified RedProtocolSharp/bin/Release/net7.0/publish/RedProtocolSharp.pdb
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@

[assembly: System.Reflection.AssemblyCompanyAttribute("KusaGumina")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("0.0.2.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("0.0.2")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("0.0.3.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("0.0.3")]
[assembly: System.Reflection.AssemblyProductAttribute("RedProtocolSharp")]
[assembly: System.Reflection.AssemblyTitleAttribute("RedProtocolSharp")]
[assembly: System.Reflection.AssemblyVersionAttribute("0.0.2.0")]
[assembly: System.Reflection.AssemblyVersionAttribute("0.0.3.0")]
[assembly: System.Reflection.AssemblyMetadataAttribute("RepositoryUrl", "https://github.com/KusaGumina/RedProtocolSharp")]

// 由 MSBuild WriteCodeFragment 类生成。
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5be38bafd18340db2a7b25b3053001b22f7ff6ce
0c4e8518959f7411476d7d792c531d803659d31d
Binary file modified RedProtocolSharp/obj/Release/net7.0/RedProtocolSharp.dll
Binary file not shown.
Binary file modified RedProtocolSharp/obj/Release/net7.0/RedProtocolSharp.pdb
Binary file not shown.
Binary file modified RedProtocolSharp/obj/Release/net7.0/ref/RedProtocolSharp.dll
Binary file not shown.
Binary file modified RedProtocolSharp/obj/Release/net7.0/refint/RedProtocolSharp.dll
Binary file not shown.

0 comments on commit 31d33d1

Please sign in to comment.