diff --git a/Mirai.Net/Mirai.Net.csproj b/Mirai.Net/Mirai.Net.csproj index ff5ae7e..99ad0cc 100644 --- a/Mirai.Net/Mirai.Net.csproj +++ b/Mirai.Net/Mirai.Net.csproj @@ -3,7 +3,7 @@ latest true - 2.4.6 + 2.4.8 Mirai.Net 基于mirai-api-http的轻量级mirai社区sdk Copyright 2022 AHpx reserve all rights. diff --git a/Mirai.Net/Sessions/Http/Managers/ConsoleManager.cs b/Mirai.Net/Sessions/Http/Managers/ConsoleManager.cs index 91c4012..cd07794 100644 --- a/Mirai.Net/Sessions/Http/Managers/ConsoleManager.cs +++ b/Mirai.Net/Sessions/Http/Managers/ConsoleManager.cs @@ -1,5 +1,6 @@ using Manganese.Array; using Mirai.Net.Data.Events; +using Mirai.Net.Data.Messages; using Mirai.Net.Data.Sessions; using Mirai.Net.Utils.Internal; using Newtonsoft.Json; @@ -48,9 +49,12 @@ static ConsoleManager() /// 控制台支持以不同消息类型作为指令的参数, 执行命令需要以消息类型作为参数, 若执行纯文本的命令, 构建多个文本格式的消息控制台会将第一个消息作为指令名, 后续消息作为参数 /// /// - public static async Task ExecuteCommandAsync(object[] command) + public static async Task ExecuteCommandAsync(MessageBase[] command) { - await HttpEndpoints.ExecuteCommand.PostJsonAsync(command); + await HttpEndpoints.ExecuteCommand.PostJsonAsync(new + { + command + }); } /// diff --git a/Mirai.Net/Sessions/Http/Managers/GroupManager.cs b/Mirai.Net/Sessions/Http/Managers/GroupManager.cs index a4fb195..f7a8970 100644 --- a/Mirai.Net/Sessions/Http/Managers/GroupManager.cs +++ b/Mirai.Net/Sessions/Http/Managers/GroupManager.cs @@ -23,9 +23,9 @@ public static class GroupManager /// /// 禁言某群员 /// - /// - /// - /// + /// 禁言对象的QQ号 + /// 禁言对象所在的群号 + /// 禁言的时长 public static async Task MuteAsync(string memberId, string group, int time) { var payload = new @@ -47,8 +47,8 @@ public static async Task MuteAsync(string memberId, string group, TimeSpan time) /// /// 禁言某群员 /// - /// - /// + /// 禁言的对象 + /// 禁言的时长 public static async Task MuteAsync(this Member member, int time) { await MuteAsync(member.Id, member.Group.Id, time); @@ -67,8 +67,8 @@ public static async Task MuteAsync(this Member member, TimeSpan time) /// /// 取消禁言 /// - /// - /// + /// 取消禁言对象的QQ号 + /// 取消禁言对象所在的群号 public static async Task UnMuteAsync(string memberId, string group) { var payload = new @@ -83,7 +83,7 @@ public static async Task UnMuteAsync(string memberId, string group) /// /// 取消禁言 /// - /// + /// 取消禁言的对象 public static async Task UnMuteAsync(this Member member) { await UnMuteAsync(member.Id, member.Group.Id); @@ -96,9 +96,9 @@ public static async Task UnMuteAsync(this Member member) /// /// 踢出某群员 /// - /// - /// - /// + /// 踢出对象的QQ号 + /// 踢出对象所在的群号 + /// 踢出的原因 public static async Task KickAsync(string memberId, string group, string message = "") { var payload = new @@ -114,8 +114,8 @@ public static async Task KickAsync(string memberId, string group, string message /// /// 踢出某群员 /// - /// - /// + /// 踢出的对象 + /// 踢出的原因 public static async Task KickAsync(this Member member, string message = "") { await KickAsync(member.Id, member.Group.Id); @@ -128,7 +128,7 @@ public static async Task KickAsync(this Member member, string message = "") /// /// bot退出某群 /// - /// + /// 要退出的群号 public static async Task LeaveAsync(string groupId) { var payload = new @@ -142,7 +142,7 @@ public static async Task LeaveAsync(string groupId) /// /// bot退出某群 /// - /// + /// 要退出的群 public static async Task LeaveAsync(this Group group) { await LeaveAsync(group.Id); @@ -155,8 +155,8 @@ public static async Task LeaveAsync(this Group group) /// /// 全体禁言 /// - /// - /// 是否禁言 + /// 目标群号 + /// 是否禁言。 false为解除禁言,true为禁言 public static async Task MuteAllAsync(string groupId, bool mute = true) { var endpoint = mute ? HttpEndpoints.MuteAll : HttpEndpoints.UnmuteAll; @@ -171,8 +171,8 @@ public static async Task MuteAllAsync(string groupId, bool mute = true) /// /// 全体禁言 /// - /// - /// 是否禁言 + /// 目标群 + /// 是否禁言。 false为解除禁言,true为禁言 public static async Task MuteAllAsync(this Group group, bool mute = true) { await MuteAllAsync(group.Id, mute); @@ -186,7 +186,7 @@ public static async Task MuteAllAsync(this Group group, bool mute = true) /// 设置精华消息 /// /// 消息id - /// 群号 + /// 目标群号 public static async Task SetEssenceMessageAsync(string messageId, string groupId) { var payload = new @@ -218,7 +218,7 @@ await SetEssenceMessageAsync(receiver.MessageChain.OfType().Singl /// /// 获取群设置 /// - /// + /// 目标群号 /// public static async Task GetGroupSettingAsync(string groupId) { @@ -241,8 +241,8 @@ public static async Task GetGroupSettingAsync(this Group group) /// /// 修改群设置 /// - /// - /// + /// 目标群号 + /// 群设置 public static async Task SetGroupSettingAsync(string groupId, GroupSetting setting) { var payload = new @@ -257,8 +257,8 @@ public static async Task SetGroupSettingAsync(string groupId, GroupSetting setti /// /// 修改群设置 /// - /// - /// + /// 目标群 + /// 群设置 public static async Task SetGroupSettingAsync(this Group group, GroupSetting setting) { await SetGroupSettingAsync(group.Id, setting); @@ -271,8 +271,8 @@ public static async Task SetGroupSettingAsync(this Group group, GroupSetting set /// /// 获取群员 /// - /// - /// + /// 目标的QQ号 + /// 目标群号 /// public static async Task GetMemberAsync(string memberQQ, string group) { @@ -288,8 +288,8 @@ public static async Task GetMemberAsync(string memberQQ, string group) /// /// 修改群员设置,需要相关的权限 /// - /// - /// + /// 目标的QQ号 + /// 目标群号 /// 群名片, 需要管理员权限 /// 群头衔, 需要群主权限 /// @@ -319,7 +319,7 @@ public static async Task SetMemberInfoAsync(string memberQQ, string grou /// /// 获取指定群公告列表 /// - /// 群号 + /// 目标群号 /// 分页参数 /// 分页参数,默认10 /// @@ -338,7 +338,7 @@ public static async Task> GetGroupAnnouncementAsync(st /// /// 向指定群发布群公告 /// - /// 群号 + /// 目标群号 /// 公告内容 /// 是否置顶 /// @@ -369,7 +369,7 @@ public static async Task PublishGroupAnnouncementAsync(Announcemen /// /// 删除指定群中一条公告 /// - /// 群号 + /// 目标群号 /// 群公告唯一id /// public static async Task DeleteGroupAnnouncementAsync(string group, string fid) diff --git a/README.md b/README.md index b4ecc79..2ed07f6 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Mirai.Net 2.4.6 +# Mirai.Net 2.4.8 Mirai.Net 是基于 [mirai-api-http] 实现的 C# 版轻量级 [mirai] 社区 SDK。 @@ -76,6 +76,9 @@ _斜体的标注的接口是不稳定的_ - 修改群设置 - 获取群员设置 - 修改群员设置 + - 获取群公告 + - 发布群公告 + - 删除群公告 - 事件处理 - 添加好友申请 - 用户入群申请