Skip to content

Commit

Permalink
Merge pull request #64 from GodLeaveMe/2.4
Browse files Browse the repository at this point in the history
bump nuget version.
  • Loading branch information
ksharperd authored Nov 24, 2022
2 parents 83da008 + 2557d20 commit 520b2c1
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 36 deletions.
2 changes: 1 addition & 1 deletion Mirai.Net/Mirai.Net.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<LangVersion>latest</LangVersion>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageVersion>2.4.6</PackageVersion>
<PackageVersion>2.4.8</PackageVersion>
<Title>Mirai.Net</Title>
<Description>基于mirai-api-http的轻量级mirai社区sdk</Description>
<Copyright>Copyright 2022 AHpx reserve all rights.</Copyright>
Expand Down
8 changes: 6 additions & 2 deletions Mirai.Net/Sessions/Http/Managers/ConsoleManager.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -48,9 +49,12 @@ static ConsoleManager()
/// <para>控制台支持以不同消息类型作为指令的参数, 执行命令需要以消息类型作为参数, 若执行纯文本的命令, 构建多个文本格式的消息控制台会将第一个消息作为指令名, 后续消息作为参数</para>
/// </param>
/// <returns></returns>
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
});
}

/// <summary>
Expand Down
64 changes: 32 additions & 32 deletions Mirai.Net/Sessions/Http/Managers/GroupManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ public static class GroupManager
/// <summary>
/// 禁言某群员
/// </summary>
/// <param name="target"></param>
/// <param name="group"></param>
/// <param name="time"></param>
/// <param name="memberId">禁言对象的QQ号</param>
/// <param name="group">禁言对象所在的群号</param>
/// <param name="time">禁言的时长</param>
public static async Task MuteAsync(string memberId, string group, int time)
{
var payload = new
Expand All @@ -47,8 +47,8 @@ public static async Task MuteAsync(string memberId, string group, TimeSpan time)
/// <summary>
/// 禁言某群员
/// </summary>
/// <param name="member"></param>
/// <param name="time"></param>
/// <param name="member">禁言的对象</param>
/// <param name="time">禁言的时长</param>
public static async Task MuteAsync(this Member member, int time)
{
await MuteAsync(member.Id, member.Group.Id, time);
Expand All @@ -67,8 +67,8 @@ public static async Task MuteAsync(this Member member, TimeSpan time)
/// <summary>
/// 取消禁言
/// </summary>
/// <param name="target"></param>
/// <param name="group"></param>
/// <param name="memberId">取消禁言对象的QQ号</param>
/// <param name="group">取消禁言对象所在的群号</param>
public static async Task UnMuteAsync(string memberId, string group)
{
var payload = new
Expand All @@ -83,7 +83,7 @@ public static async Task UnMuteAsync(string memberId, string group)
/// <summary>
/// 取消禁言
/// </summary>
/// <param name="member"></param>
/// <param name="member">取消禁言的对象</param>
public static async Task UnMuteAsync(this Member member)
{
await UnMuteAsync(member.Id, member.Group.Id);
Expand All @@ -96,9 +96,9 @@ public static async Task UnMuteAsync(this Member member)
/// <summary>
/// 踢出某群员
/// </summary>
/// <param name="target"></param>
/// <param name="group"></param>
/// <param name="message"></param>
/// <param name="memberId">踢出对象的QQ号</param>
/// <param name="group">踢出对象所在的群号</param>
/// <param name="message">踢出的原因</param>
public static async Task KickAsync(string memberId, string group, string message = "")
{
var payload = new
Expand All @@ -114,8 +114,8 @@ public static async Task KickAsync(string memberId, string group, string message
/// <summary>
/// 踢出某群员
/// </summary>
/// <param name="member"></param>
/// <param name="message"></param>
/// <param name="member">踢出的对象</param>
/// <param name="message">踢出的原因</param>
public static async Task KickAsync(this Member member, string message = "")
{
await KickAsync(member.Id, member.Group.Id);
Expand All @@ -128,7 +128,7 @@ public static async Task KickAsync(this Member member, string message = "")
/// <summary>
/// bot退出某群
/// </summary>
/// <param name="target"></param>
/// <param name="groupId">要退出的群号</param>
public static async Task LeaveAsync(string groupId)
{
var payload = new
Expand All @@ -142,7 +142,7 @@ public static async Task LeaveAsync(string groupId)
/// <summary>
/// bot退出某群
/// </summary>
/// <param name="group"></param>
/// <param name="group">要退出的群</param>
public static async Task LeaveAsync(this Group group)
{
await LeaveAsync(group.Id);
Expand All @@ -155,8 +155,8 @@ public static async Task LeaveAsync(this Group group)
/// <summary>
/// 全体禁言
/// </summary>
/// <param name="target"></param>
/// <param name="mute">是否禁言</param>
/// <param name="groupId">目标群号</param>
/// <param name="mute">是否禁言。 false为解除禁言,true为禁言</param>
public static async Task MuteAllAsync(string groupId, bool mute = true)
{
var endpoint = mute ? HttpEndpoints.MuteAll : HttpEndpoints.UnmuteAll;
Expand All @@ -171,8 +171,8 @@ public static async Task MuteAllAsync(string groupId, bool mute = true)
/// <summary>
/// 全体禁言
/// </summary>
/// <param name="group"></param>
/// <param name="mute">是否禁言</param>
/// <param name="group">目标群</param>
/// <param name="mute">是否禁言。 false为解除禁言,true为禁言</param>
public static async Task MuteAllAsync(this Group group, bool mute = true)
{
await MuteAllAsync(group.Id, mute);
Expand All @@ -186,7 +186,7 @@ public static async Task MuteAllAsync(this Group group, bool mute = true)
/// 设置精华消息
/// </summary>
/// <param name="messageId">消息id</param>
/// <param name="groupId">群号</param>
/// <param name="groupId">目标群号</param>
public static async Task SetEssenceMessageAsync(string messageId, string groupId)
{
var payload = new
Expand Down Expand Up @@ -218,7 +218,7 @@ await SetEssenceMessageAsync(receiver.MessageChain.OfType<SourceMessage>().Singl
/// <summary>
/// 获取群设置
/// </summary>
/// <param name="target"></param>
/// <param name="groupId">目标群号</param>
/// <returns></returns>
public static async Task<GroupSetting> GetGroupSettingAsync(string groupId)
{
Expand All @@ -241,8 +241,8 @@ public static async Task<GroupSetting> GetGroupSettingAsync(this Group group)
/// <summary>
/// 修改群设置
/// </summary>
/// <param name="target"></param>
/// <param name="setting"></param>
/// <param name="groupId">目标群号</param>
/// <param name="setting">群设置</param>
public static async Task SetGroupSettingAsync(string groupId, GroupSetting setting)
{
var payload = new
Expand All @@ -257,8 +257,8 @@ public static async Task SetGroupSettingAsync(string groupId, GroupSetting setti
/// <summary>
/// 修改群设置
/// </summary>
/// <param name="group"></param>
/// <param name="setting"></param>
/// <param name="group">目标群</param>
/// <param name="setting">群设置</param>
public static async Task SetGroupSettingAsync(this Group group, GroupSetting setting)
{
await SetGroupSettingAsync(group.Id, setting);
Expand All @@ -271,8 +271,8 @@ public static async Task SetGroupSettingAsync(this Group group, GroupSetting set
/// <summary>
/// 获取群员
/// </summary>
/// <param name="memberQQ"></param>
/// <param name="group"></param>
/// <param name="memberQQ">目标的QQ号</param>
/// <param name="group">目标群号</param>
/// <returns></returns>
public static async Task<Member> GetMemberAsync(string memberQQ, string group)
{
Expand All @@ -288,8 +288,8 @@ public static async Task<Member> GetMemberAsync(string memberQQ, string group)
/// <summary>
/// 修改群员设置,需要相关的权限
/// </summary>
/// <param name="memberQQ"></param>
/// <param name="group"></param>
/// <param name="memberQQ">目标的QQ号</param>
/// <param name="group">目标群号</param>
/// <param name="card">群名片, 需要管理员权限</param>
/// <param name="title">群头衔, 需要群主权限</param>
/// <returns></returns>
Expand Down Expand Up @@ -319,7 +319,7 @@ public static async Task<Member> SetMemberInfoAsync(string memberQQ, string grou
/// <summary>
/// 获取指定群公告列表
/// </summary>
/// <param name="group">群号</param>
/// <param name="group">目标群号</param>
/// <param name="offset">分页参数</param>
/// <param name="size">分页参数,默认10</param>
/// <returns></returns>
Expand All @@ -338,7 +338,7 @@ public static async Task<IEnumerable<Announcement>> GetGroupAnnouncementAsync(st
/// <summary>
/// 向指定群发布群公告
/// </summary>
/// <param name="group">群号</param>
/// <param name="group">目标群号</param>
/// <param name="content">公告内容</param>
/// <param name="pinned">是否置顶</param>
/// <returns></returns>
Expand Down Expand Up @@ -369,7 +369,7 @@ public static async Task<Announcement> PublishGroupAnnouncementAsync(Announcemen
/// <summary>
/// 删除指定群中一条公告
/// </summary>
/// <param name="group">群号</param>
/// <param name="group">目标群号</param>
/// <param name="fid">群公告唯一id</param>
/// <returns></returns>
public static async Task DeleteGroupAnnouncementAsync(string group, string fid)
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Mirai.Net 2.4.6
# Mirai.Net 2.4.8

Mirai.Net 是基于 [mirai-api-http] 实现的 C# 版轻量级 [mirai] 社区 SDK。

Expand Down Expand Up @@ -76,6 +76,9 @@ _斜体的标注的接口是不稳定的_
- 修改群设置
- 获取群员设置
- 修改群员设置
- 获取群公告
- 发布群公告
- 删除群公告
- 事件处理
- 添加好友申请
- 用户入群申请
Expand Down

0 comments on commit 520b2c1

Please sign in to comment.