diff --git a/src/QQBot.Net.Core/Entities/Guilds/IGuild.cs b/src/QQBot.Net.Core/Entities/Guilds/IGuild.cs index f9c67c1..835d4fc 100644 --- a/src/QQBot.Net.Core/Entities/Guilds/IGuild.cs +++ b/src/QQBot.Net.Core/Entities/Guilds/IGuild.cs @@ -84,6 +84,23 @@ public interface IGuild : IEntity /// 一个表示异步获取操作的任务。任务的结果包含此频道的所有角色。 Task> GetRolesAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions? options = null); + /// + /// 获取此频道的角色。 + /// + /// 要获取的角色的 ID。 + /// 指示当前方法是否应该仅从缓存中获取结果,还是可以通过 API 请求获取数据。 + /// 发送请求时要使用的选项。 + /// 一个表示异步获取操作的任务。任务的结果包含此频道的所有角色。 + Task GetRoleAsync(uint id, CacheMode mode = CacheMode.AllowDownload, RequestOptions? options = null); + + /// + /// 在此服务器内创建一个新的角色。 + /// + /// 一个包含要应用到新创建角色的配置的委托。 + /// 发送请求时要使用的选项。 + /// 一个表示异步创建操作的任务。任务的结果包含新创建的角色。 + Task CreateRoleAsync(Action func, RequestOptions? options = null); + #endregion #region Users diff --git a/src/QQBot.Net.Core/Entities/Roles/IRole.cs b/src/QQBot.Net.Core/Entities/Roles/IRole.cs index 10053da..988ddbd 100644 --- a/src/QQBot.Net.Core/Entities/Roles/IRole.cs +++ b/src/QQBot.Net.Core/Entities/Roles/IRole.cs @@ -3,7 +3,7 @@ /// /// 表示一个子频道身份组。 /// -public interface IRole : IEntity +public interface IRole : IEntity, IDeletable { /// /// 获取拥有此角色的频道。 @@ -47,4 +47,15 @@ public interface IRole : IEntity /// 发送请求时要使用的选项。 /// 一个表示异步获取操作的任务。任务的结果包含所有拥有此身份组的用户。 IAsyncEnumerable> GetUsersAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions? options = null); + + /// + /// 修改此角色。 + /// + /// + /// 此方法使用指定的属性修改当前角色信息。要查看可用的属性,请参考 。 + /// + /// 一个包含修改角色属性的委托。 + /// 发送请求时要使用的选项。 + /// 一个表示异步修改操作的任务。 + Task ModifyAsync(Action func, RequestOptions? options = null); } diff --git a/src/QQBot.Net.Core/Entities/Roles/RoleProperties.cs b/src/QQBot.Net.Core/Entities/Roles/RoleProperties.cs new file mode 100644 index 0000000..bfa9a73 --- /dev/null +++ b/src/QQBot.Net.Core/Entities/Roles/RoleProperties.cs @@ -0,0 +1,23 @@ +namespace QQBot; + +/// +/// 提供用于创建与修改 的属性。 +/// +/// +public class RoleProperties +{ + /// + /// 获取或设置要设置到此角色的名称。 + /// + public string? Name { get; set; } + + /// + /// 获取或设置要设置到此角色的颜色。 + /// + public AlphaColor? Color { get; set; } + + /// + /// 获取或设置要设置到此角色拥有此角色的用户是否在用户列表中与普通在线成员分开显示。 + /// + public bool? IsHoisted { get; set; } +} diff --git a/src/QQBot.Net.Core/Net/HttpException.cs b/src/QQBot.Net.Core/Net/HttpException.cs index cad6371..60b88b4 100644 --- a/src/QQBot.Net.Core/Net/HttpException.cs +++ b/src/QQBot.Net.Core/Net/HttpException.cs @@ -1,4 +1,3 @@ -using System.Collections.Immutable; using System.Net; namespace QQBot.Net; diff --git a/src/QQBot.Net.Core/Net/Queue/BaseMessageQueue.cs b/src/QQBot.Net.Core/Net/Queue/BaseMessageQueue.cs index 14ead1f..4dc3863 100644 --- a/src/QQBot.Net.Core/Net/Queue/BaseMessageQueue.cs +++ b/src/QQBot.Net.Core/Net/Queue/BaseMessageQueue.cs @@ -1,6 +1,4 @@ -using System.Text.Json; - -namespace QQBot.Net.Queue; +namespace QQBot.Net.Queue; /// /// 表示一个通用的消息队列抽象类。 diff --git a/src/QQBot.Net.Core/Net/Queue/MessageQueueProvider.cs b/src/QQBot.Net.Core/Net/Queue/MessageQueueProvider.cs index eba23fc..88778a0 100644 --- a/src/QQBot.Net.Core/Net/Queue/MessageQueueProvider.cs +++ b/src/QQBot.Net.Core/Net/Queue/MessageQueueProvider.cs @@ -1,6 +1,4 @@ -using System.Text.Json; - -namespace QQBot.Net.Queue; +namespace QQBot.Net.Queue; /// /// 表示一个提供新的 实例的委托。 diff --git a/src/QQBot.Net.Core/Net/Queue/SynchronousImmediateMessageQueue.cs b/src/QQBot.Net.Core/Net/Queue/SynchronousImmediateMessageQueue.cs index e5ddb27..2c2c95a 100644 --- a/src/QQBot.Net.Core/Net/Queue/SynchronousImmediateMessageQueue.cs +++ b/src/QQBot.Net.Core/Net/Queue/SynchronousImmediateMessageQueue.cs @@ -1,6 +1,4 @@ -using System.Text.Json; - -namespace QQBot.Net.Queue.SynchronousImmediate; +namespace QQBot.Net.Queue.SynchronousImmediate; /// /// 表示一个同步处理消息队列。 diff --git a/src/QQBot.Net.Core/Utils/Paging/Page.cs b/src/QQBot.Net.Core/Utils/Paging/Page.cs index 4af04eb..25b7842 100644 --- a/src/QQBot.Net.Core/Utils/Paging/Page.cs +++ b/src/QQBot.Net.Core/Utils/Paging/Page.cs @@ -1,5 +1,4 @@ using System.Collections; -using System.Collections.Generic; using System.Collections.Immutable; namespace QQBot diff --git a/src/QQBot.Net.Core/Utils/TokenUtils.cs b/src/QQBot.Net.Core/Utils/TokenUtils.cs index 79131a3..1913421 100644 --- a/src/QQBot.Net.Core/Utils/TokenUtils.cs +++ b/src/QQBot.Net.Core/Utils/TokenUtils.cs @@ -1,6 +1,3 @@ -using System.Globalization; -using System.Text; - namespace QQBot; /// diff --git a/src/QQBot.Net.Rest/API/Rest/GetGuildRoleMembersParams.cs b/src/QQBot.Net.Rest/API/Rest/GetGuildRoleMembersParams.cs index 4194065..a3dc256 100644 --- a/src/QQBot.Net.Rest/API/Rest/GetGuildRoleMembersParams.cs +++ b/src/QQBot.Net.Rest/API/Rest/GetGuildRoleMembersParams.cs @@ -1,5 +1,3 @@ -using System.Text.Json.Serialization; - namespace QQBot.API.Rest; internal class GetGuildRoleMembersParams diff --git a/src/QQBot.Net.Rest/Entities/Guilds/GuildHelper.cs b/src/QQBot.Net.Rest/Entities/Guilds/GuildHelper.cs index ffc33bb..aa9d7b1 100644 --- a/src/QQBot.Net.Rest/Entities/Guilds/GuildHelper.cs +++ b/src/QQBot.Net.Rest/Entities/Guilds/GuildHelper.cs @@ -219,10 +219,6 @@ public static IAsyncEnumerable> GetUsersAsync( #region Roles - - - #endregion - public static async Task> GetRolesAsync(IGuild guild, BaseQQBotClient client, RequestOptions? options) { @@ -230,4 +226,30 @@ public static async Task> GetRolesAsync(IGuild gui await client.ApiClient.GetGuildRolesAsync(guild.Id, options).ConfigureAwait(false); return [..model.Roles.Select(x => RestRole.Create(guild, client, x))]; } + + public static async Task GetRoleAsync(IGuild guild, + BaseQQBotClient client, ulong id, RequestOptions? options) + { + GetGuildRolesResponse model = + await client.ApiClient.GetGuildRolesAsync(guild.Id, options).ConfigureAwait(false); + Role? role = model.Roles.FirstOrDefault(x => x.Id == id); + return role is not null ? RestRole.Create(guild, client, role) : null; + } + + public static async Task CreateRoleAsync(IGuild guild, BaseQQBotClient client, + Action? func, RequestOptions? options) + { + RoleProperties properties = new(); + func?.Invoke(properties); + CreateGuildRoleParams args = new() + { + Name = properties.Name, + Color = properties.Color, + Hoist = properties.IsHoisted + }; + CreateGuildRoleResponse model = await client.ApiClient.CreateGuildRoleAsync(guild.Id, args, options); + return RestRole.Create(guild, client, model.Role); + } + + #endregion } diff --git a/src/QQBot.Net.Rest/Entities/Guilds/RestGuild.cs b/src/QQBot.Net.Rest/Entities/Guilds/RestGuild.cs index 06e9499..39e5e9e 100644 --- a/src/QQBot.Net.Rest/Entities/Guilds/RestGuild.cs +++ b/src/QQBot.Net.Rest/Entities/Guilds/RestGuild.cs @@ -295,6 +295,19 @@ public Task CreateCategoryChannelAsync(string name, public Task> GetRolesAsync(RequestOptions? options = null) => GuildHelper.GetRolesAsync(this, Client, options); + /// + /// 获取此频道的角色。 + /// + /// 要获取的角色的 ID。 + /// 发送请求时要使用的选项。 + /// 一个表示异步获取操作的任务。任务的结果包含此频道的所有角色。 + public Task GetRoleAsync(uint id, RequestOptions? options = null) => + GuildHelper.GetRoleAsync(this, Client, id, options); + + /// + public Task CreateRoleAsync(Action? func = null, RequestOptions? options = null) => + GuildHelper.CreateRoleAsync(this, Client, func, options); + #endregion #region Users @@ -398,29 +411,36 @@ async Task> IGuild.GetCategoryChannelsAsyn async Task IGuild.GetCategoryChannelAsync(ulong id, CacheMode mode, RequestOptions? options) => mode == CacheMode.AllowDownload ? await GetCategoryChannelAsync(id, options).ConfigureAwait(false) : null; - async Task IGuild.CreateTextChannelAsync(string name, Action? action, RequestOptions? options) => - await CreateTextChannelAsync(name, action, options).ConfigureAwait(false); + async Task IGuild.CreateTextChannelAsync(string name, Action? func, RequestOptions? options) => + await CreateTextChannelAsync(name, func, options).ConfigureAwait(false); - async Task IGuild.CreateVoiceChannelAsync(string name, Action? action, RequestOptions? options) => - await CreateVoiceChannelAsync(name, action, options).ConfigureAwait(false); + async Task IGuild.CreateVoiceChannelAsync(string name, Action? func, RequestOptions? options) => + await CreateVoiceChannelAsync(name, func, options).ConfigureAwait(false); - async Task IGuild.CreateLiveStreamChannelAsync(string name, Action? action, RequestOptions? options) => - await CreateLiveStreamChannelAsync(name, action, options).ConfigureAwait(false); + async Task IGuild.CreateLiveStreamChannelAsync(string name, Action? func, RequestOptions? options) => + await CreateLiveStreamChannelAsync(name, func, options).ConfigureAwait(false); - async Task IGuild.CreateApplicationChannelAsync(string name, Action? action, RequestOptions? options) => - await CreateApplicationChannelAsync(name, action, options).ConfigureAwait(false); + async Task IGuild.CreateApplicationChannelAsync(string name, Action? func, RequestOptions? options) => + await CreateApplicationChannelAsync(name, func, options).ConfigureAwait(false); - async Task IGuild.CreateForumChannelAsync(string name, Action? action, RequestOptions? options) => - await CreateForumChannelAsync(name, action, options).ConfigureAwait(false); + async Task IGuild.CreateForumChannelAsync(string name, Action? func, RequestOptions? options) => + await CreateForumChannelAsync(name, func, options).ConfigureAwait(false); - async Task IGuild.CreateScheduleChannelAsync(string name, Action? action, RequestOptions? options) => - await CreateScheduleChannelAsync(name, action, options).ConfigureAwait(false); + async Task IGuild.CreateScheduleChannelAsync(string name, Action? func, RequestOptions? options) => + await CreateScheduleChannelAsync(name, func, options).ConfigureAwait(false); - async Task IGuild.CreateCategoryChannelAsync(string name, Action? action, RequestOptions? options) => - await CreateCategoryChannelAsync(name, action, options).ConfigureAwait(false); + async Task IGuild.CreateCategoryChannelAsync(string name, Action? func, RequestOptions? options) => + await CreateCategoryChannelAsync(name, func, options).ConfigureAwait(false); async Task> IGuild.GetRolesAsync(CacheMode mode, RequestOptions? options) => mode is CacheMode.CacheOnly ? ([]) : await GetRolesAsync(options).ConfigureAwait(false); + async Task IGuild.GetRoleAsync(uint id, CacheMode mode, RequestOptions? options) => + mode is CacheMode.CacheOnly ? null : await GetRoleAsync(id, options).ConfigureAwait(false); + + /// + async Task IGuild.CreateRoleAsync(Action func, RequestOptions? options) => + await CreateRoleAsync(func, options); + #endregion } diff --git a/src/QQBot.Net.Rest/Entities/Messages/MessageHelper.cs b/src/QQBot.Net.Rest/Entities/Messages/MessageHelper.cs index 940b9a9..6f6dd4f 100644 --- a/src/QQBot.Net.Rest/Entities/Messages/MessageHelper.cs +++ b/src/QQBot.Net.Rest/Entities/Messages/MessageHelper.cs @@ -1,5 +1,4 @@ using System.Collections.Immutable; -using System.Text.RegularExpressions; using QQBot.API.Rest; namespace QQBot.Rest; diff --git a/src/QQBot.Net.Rest/Entities/Roles/RestRole.cs b/src/QQBot.Net.Rest/Entities/Roles/RestRole.cs index e7aafb4..79e1e6e 100644 --- a/src/QQBot.Net.Rest/Entities/Roles/RestRole.cs +++ b/src/QQBot.Net.Rest/Entities/Roles/RestRole.cs @@ -67,6 +67,17 @@ internal void Update(Model model) public IAsyncEnumerable> GetUsersAsync(RequestOptions? options = null) => RoleHelper.GetUsersAsync(this, Client, null, options); + /// + public async Task ModifyAsync(Action func, RequestOptions? options = null) + { + Model model = await RoleHelper.ModifyAsync(this, Client, func, options); + Update(model); + } + + /// + public Task DeleteAsync(RequestOptions? options = null) => + RoleHelper.DeleteAsync(this, Client, options); + /// public override string ToString() => Name; diff --git a/src/QQBot.Net.Rest/Entities/Roles/RoleHelper.cs b/src/QQBot.Net.Rest/Entities/Roles/RoleHelper.cs index 4a3021c..7d31d5e 100644 --- a/src/QQBot.Net.Rest/Entities/Roles/RoleHelper.cs +++ b/src/QQBot.Net.Rest/Entities/Roles/RoleHelper.cs @@ -5,6 +5,31 @@ namespace QQBot.Rest; internal static class RoleHelper { + #region Roles + + public static async Task ModifyAsync(IRole role, BaseQQBotClient client, + Action? func, RequestOptions? options) + { + RoleProperties properties = new() + { + Name = role.Name, + Color = role.Color, + IsHoisted = role.IsHoisted + }; + func?.Invoke(properties); + ModifyGuildRoleParams args = new() + { + Name = properties.Name, + Color = properties.Color, + Hoist = properties.IsHoisted + }; + ModifyGuildRoleResponse model = await client.ApiClient + .ModifyGuildRoleAsync(role.Guild.Id, role.Id, args, options); + return model.Role; + } + + #endregion + #region Users public static async IAsyncEnumerable> GetUsersAsync( @@ -16,7 +41,7 @@ public static async IAsyncEnumerable> GetUs { GetGuildRoleMembersParams args = new() { - Limit = QQBotConfig.MaxMembersPerBatch, + Limit = Math.Clamp(limit ?? QQBotConfig.MaxMembersPerBatch, 1, QQBotConfig.MaxMembersPerBatch), StartIndex = startIndex }; GetGuildRoleMembersResponse model = await client.ApiClient @@ -31,4 +56,7 @@ public static async IAsyncEnumerable> GetUs } #endregion + + public static async Task DeleteAsync(IRole role, BaseQQBotClient client, RequestOptions? options) => + await client.ApiClient.DeleteGuildRoleAsync(role.Guild.Id, role.Id, options).ConfigureAwait(false); } diff --git a/src/QQBot.Net.Rest/Net/Converters/HexAlphaColorConverter.cs b/src/QQBot.Net.Rest/Net/Converters/HexAlphaColorConverter.cs index e5cde65..f4ef9c2 100644 --- a/src/QQBot.Net.Rest/Net/Converters/HexAlphaColorConverter.cs +++ b/src/QQBot.Net.Rest/Net/Converters/HexAlphaColorConverter.cs @@ -1,5 +1,4 @@ -using System.Globalization; -using System.Text.Json; +using System.Text.Json; using System.Text.Json.Serialization; namespace QQBot.Net.Converters; diff --git a/src/QQBot.Net.WebSocket/API/Gateway/GatewaySocketFrame.cs b/src/QQBot.Net.WebSocket/API/Gateway/GatewaySocketFrame.cs index c7979bb..4fe21dd 100644 --- a/src/QQBot.Net.WebSocket/API/Gateway/GatewaySocketFrame.cs +++ b/src/QQBot.Net.WebSocket/API/Gateway/GatewaySocketFrame.cs @@ -1,4 +1,3 @@ -using System.Text.Json; using System.Text.Json.Serialization; namespace QQBot.API.Gateway; diff --git a/src/QQBot.Net.WebSocket/Entities/Channels/SocketDMChannel.cs b/src/QQBot.Net.WebSocket/Entities/Channels/SocketDMChannel.cs index 22cf49f..a1a4db2 100644 --- a/src/QQBot.Net.WebSocket/Entities/Channels/SocketDMChannel.cs +++ b/src/QQBot.Net.WebSocket/Entities/Channels/SocketDMChannel.cs @@ -1,4 +1,3 @@ -using System.Collections.Immutable; using System.Diagnostics; using QQBot.Rest; diff --git a/src/QQBot.Net.WebSocket/Entities/Guilds/SocketGuild.cs b/src/QQBot.Net.WebSocket/Entities/Guilds/SocketGuild.cs index 8c3bc3a..cf131a2 100644 --- a/src/QQBot.Net.WebSocket/Entities/Guilds/SocketGuild.cs +++ b/src/QQBot.Net.WebSocket/Entities/Guilds/SocketGuild.cs @@ -215,6 +215,19 @@ internal void Update(ClientState state, API.Rest.GetGuildRolesResponse model) public Task> GetRolesAsync(RequestOptions? options = null) => GuildHelper.GetRolesAsync(this, Client, options); + /// + /// 获取此频道的角色。 + /// + /// 要获取的角色的 ID。 + /// 发送请求时要使用的选项。 + /// 一个表示异步获取操作的任务。任务的结果包含此频道的所有角色。 + public Task GetRoleAsync(uint id, RequestOptions? options = null) => + GuildHelper.GetRoleAsync(this, Client, id, options); + + /// + public Task CreateRoleAsync(Action? func = null, RequestOptions? options = null) => + GuildHelper.CreateRoleAsync(this, Client, func, options); + #endregion #region Users @@ -434,26 +447,26 @@ Task> IGuild.GetCategoryChannelsAsync(Cach Task IGuild.GetCategoryChannelAsync(ulong id, CacheMode mode, RequestOptions? options) => Task.FromResult(GetCategoryChannel(id)); - async Task IGuild.CreateTextChannelAsync(string name, Action? action, RequestOptions? options) => - await CreateTextChannelAsync(name, action, options).ConfigureAwait(false); + async Task IGuild.CreateTextChannelAsync(string name, Action? func, RequestOptions? options) => + await CreateTextChannelAsync(name, func, options).ConfigureAwait(false); - async Task IGuild.CreateVoiceChannelAsync(string name, Action? action, RequestOptions? options) => - await CreateVoiceChannelAsync(name, action, options).ConfigureAwait(false); + async Task IGuild.CreateVoiceChannelAsync(string name, Action? func, RequestOptions? options) => + await CreateVoiceChannelAsync(name, func, options).ConfigureAwait(false); - async Task IGuild.CreateLiveStreamChannelAsync(string name, Action? action, RequestOptions? options) => - await CreateLiveStreamChannelAsync(name, action, options).ConfigureAwait(false); + async Task IGuild.CreateLiveStreamChannelAsync(string name, Action? func, RequestOptions? options) => + await CreateLiveStreamChannelAsync(name, func, options).ConfigureAwait(false); - async Task IGuild.CreateApplicationChannelAsync(string name, Action? action, RequestOptions? options) => - await CreateApplicationChannelAsync(name, action, options).ConfigureAwait(false); + async Task IGuild.CreateApplicationChannelAsync(string name, Action? func, RequestOptions? options) => + await CreateApplicationChannelAsync(name, func, options).ConfigureAwait(false); - async Task IGuild.CreateForumChannelAsync(string name, Action? action, RequestOptions? options) => - await CreateForumChannelAsync(name, action, options).ConfigureAwait(false); + async Task IGuild.CreateForumChannelAsync(string name, Action? func, RequestOptions? options) => + await CreateForumChannelAsync(name, func, options).ConfigureAwait(false); - async Task IGuild.CreateScheduleChannelAsync(string name, Action? action, RequestOptions? options) => - await CreateScheduleChannelAsync(name, action, options).ConfigureAwait(false); + async Task IGuild.CreateScheduleChannelAsync(string name, Action? func, RequestOptions? options) => + await CreateScheduleChannelAsync(name, func, options).ConfigureAwait(false); - async Task IGuild.CreateCategoryChannelAsync(string name, Action? action, RequestOptions? options) => - await CreateCategoryChannelAsync(name, action, options).ConfigureAwait(false); + async Task IGuild.CreateCategoryChannelAsync(string name, Action? func, RequestOptions? options) => + await CreateCategoryChannelAsync(name, func, options).ConfigureAwait(false); IAsyncEnumerable> IGuild.GetUsersAsync(CacheMode mode, RequestOptions? options) => mode is CacheMode.AllowDownload && !HasAllMembers @@ -469,8 +482,17 @@ mode is CacheMode.AllowDownload && !HasAllMembers return await GetUserAsync(id, options).ConfigureAwait(false); } + /// async Task> IGuild.GetRolesAsync(CacheMode mode, RequestOptions? options) => mode is CacheMode.CacheOnly ? Roles : await GetRolesAsync(options).ConfigureAwait(false); + /// + async Task IGuild.GetRoleAsync(uint id, CacheMode mode, RequestOptions? options) => + mode is CacheMode.CacheOnly ? GetRole(id) : await GetRoleAsync(id, options).ConfigureAwait(false); + + /// + async Task IGuild.CreateRoleAsync(Action func, RequestOptions? options) => + await CreateRoleAsync(func, options); + #endregion } diff --git a/src/QQBot.Net.WebSocket/Entities/Messages/MessageCache.cs b/src/QQBot.Net.WebSocket/Entities/Messages/MessageCache.cs index 4de9e93..1990f5e 100644 --- a/src/QQBot.Net.WebSocket/Entities/Messages/MessageCache.cs +++ b/src/QQBot.Net.WebSocket/Entities/Messages/MessageCache.cs @@ -1,5 +1,4 @@ using System.Collections.Concurrent; -using System.Collections.Immutable; namespace QQBot.WebSocket; diff --git a/src/QQBot.Net.WebSocket/Entities/Roles/SocketRole.cs b/src/QQBot.Net.WebSocket/Entities/Roles/SocketRole.cs index 855998e..3cc99ac 100644 --- a/src/QQBot.Net.WebSocket/Entities/Roles/SocketRole.cs +++ b/src/QQBot.Net.WebSocket/Entities/Roles/SocketRole.cs @@ -65,6 +65,17 @@ internal void Update(ClientState state, Model model) public IAsyncEnumerable> GetUsersAsync(RequestOptions? options = null) => RoleHelper.GetUsersAsync(this, Client, null, options); + /// + public async Task ModifyAsync(Action func, RequestOptions? options = null) + { + Model model = await RoleHelper.ModifyAsync(this, Client, func, options); + Update(Client.State, model); + } + + /// + public Task DeleteAsync(RequestOptions? options = null) => + RoleHelper.DeleteAsync(this, Client, options); + /// public override string ToString() => Name; diff --git a/src/QQBot.Net.WebSocket/QQBotShardedClient.Events.cs b/src/QQBot.Net.WebSocket/QQBotShardedClient.Events.cs index 4a9839a..2d0de2a 100644 --- a/src/QQBot.Net.WebSocket/QQBotShardedClient.Events.cs +++ b/src/QQBot.Net.WebSocket/QQBotShardedClient.Events.cs @@ -1,6 +1,3 @@ -using System; -using System.Threading.Tasks; - namespace QQBot.WebSocket; public partial class QQBotShardedClient diff --git a/src/QQBot.Net.WebSocket/QQBotShardedClient.cs b/src/QQBot.Net.WebSocket/QQBotShardedClient.cs index 1bbb6cb..1b217b2 100644 --- a/src/QQBot.Net.WebSocket/QQBotShardedClient.cs +++ b/src/QQBot.Net.WebSocket/QQBotShardedClient.cs @@ -1,13 +1,5 @@ using QQBot.API; -using QQBot.Rest; -using System; -using System.Collections.Generic; -using System.Collections.Immutable; using System.Diagnostics.CodeAnalysis; -using System.IO; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; namespace QQBot.WebSocket; diff --git a/src/QQBot.Net.WebSocket/QQBotSocketClient.cs b/src/QQBot.Net.WebSocket/QQBotSocketClient.cs index 76a5fd7..fb9c527 100644 --- a/src/QQBot.Net.WebSocket/QQBotSocketClient.cs +++ b/src/QQBot.Net.WebSocket/QQBotSocketClient.cs @@ -1,15 +1,10 @@ using System.Collections.Concurrent; -using System.Collections.Immutable; -using System.Net; using System.Text.Encodings.Web; using System.Text.Json; using System.Text.Json.Serialization; using QQBot.API; using QQBot.API.Gateway; -using QQBot.API.Rest; using QQBot.Logging; -using QQBot.Net; -using QQBot.Net.Converters; using QQBot.Net.Queue; using QQBot.Net.WebSockets; using QQBot.Rest;