Skip to content

Commit

Permalink
[Refactor] Refactor some stuff (#2688)
Browse files Browse the repository at this point in the history
* fix some `internal` classes being exposed

* update xmldoc comments to use `<see langword>`

* bump library version in samples

* fix possible oversight
  • Loading branch information
Misha-133 authored Jun 27, 2023
1 parent fe4130d commit 9ddd922
Show file tree
Hide file tree
Showing 119 changed files with 326 additions and 324 deletions.
2 changes: 1 addition & 1 deletion samples/BasicBot/_BasicBot.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Discord.Net.WebSocket" Version="3.8.1"/>
<PackageReference Include="Discord.Net.WebSocket" Version="3.10.0"/>
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion samples/InteractionFramework/_InteractionFramework.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="5.0.2" />
<PackageReference Include="Discord.Net.Interactions" Version="3.8.1" />
<PackageReference Include="Discord.Net.Interactions" Version="3.10.0" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion samples/ShardedClient/_ShardedClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="5.0.2" />
<PackageReference Include="Discord.Net" Version="3.8.1" />
<PackageReference Include="Discord.Net" Version="3.10.0" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions samples/TextCommandFramework/_TextCommandFramework.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="5.0.2" />
<PackageReference Include="Discord.Net.Commands" Version="3.8.1" />
<PackageReference Include="Discord.Net.Websocket" Version="3.8.1" />
<PackageReference Include="Discord.Net.Commands" Version="3.10.0" />
<PackageReference Include="Discord.Net.Websocket" Version="3.10.0" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion samples/WebhookClient/_WebhookClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Discord.Net.Webhook" Version="3.8.1" />
<PackageReference Include="Discord.Net.Webhook" Version="3.10.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public abstract class PreconditionAttribute : Attribute
/// </summary>
/// <remarks>
/// <see cref="Preconditions" /> of the same group require only one of the preconditions to pass in order to
/// be successful (A || B). Specifying <see cref="Group" /> = <c>null</c> or not at all will
/// be successful (A || B). Specifying <see cref="Group" /> = <see langword="null" /> or not at all will
/// require *all* preconditions to pass, just like normal (A &amp;&amp; B).
/// </remarks>
public string Group { get; set; } = null;
Expand Down
6 changes: 3 additions & 3 deletions src/Discord.Net.Commands/CommandService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public async Task<ModuleInfo> CreateModuleAsync(string primaryAlias, Action<Modu
/// </code>
/// </example>
/// <typeparam name="T">The type of module.</typeparam>
/// <param name="services">The <see cref="IServiceProvider"/> for your dependency injection solution if using one; otherwise, pass <c>null</c>.</param>
/// <param name="services">The <see cref="IServiceProvider"/> for your dependency injection solution if using one; otherwise, pass <see langword="null" />.</param>
/// <exception cref="ArgumentException">This module has already been added.</exception>
/// <exception cref="InvalidOperationException">
/// The <see cref="ModuleInfo"/> fails to be built; an invalid type may have been provided.
Expand All @@ -178,7 +178,7 @@ public async Task<ModuleInfo> CreateModuleAsync(string primaryAlias, Action<Modu
/// Adds a command module from a <see cref="Type" />.
/// </summary>
/// <param name="type">The type of module.</param>
/// <param name="services">The <see cref="IServiceProvider" /> for your dependency injection solution if using one; otherwise, pass <c>null</c> .</param>
/// <param name="services">The <see cref="IServiceProvider" /> for your dependency injection solution if using one; otherwise, pass <see langword="null" /> .</param>
/// <exception cref="ArgumentException">This module has already been added.</exception>
/// <exception cref="InvalidOperationException">
/// The <see cref="ModuleInfo"/> fails to be built; an invalid type may have been provided.
Expand Down Expand Up @@ -217,7 +217,7 @@ public async Task<ModuleInfo> AddModuleAsync(Type type, IServiceProvider service
/// Add command modules from an <see cref="Assembly"/>.
/// </summary>
/// <param name="assembly">The <see cref="Assembly"/> containing command modules.</param>
/// <param name="services">The <see cref="IServiceProvider"/> for your dependency injection solution if using one; otherwise, pass <c>null</c>.</param>
/// <param name="services">The <see cref="IServiceProvider"/> for your dependency injection solution if using one; otherwise, pass <see langword="null" />.</param>
/// <returns>
/// A task that represents the asynchronous operation for adding the command modules. The task result
/// contains an enumerable collection of modules added.
Expand Down
2 changes: 1 addition & 1 deletion src/Discord.Net.Commands/Extensions/MessageExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static class MessageExtensions
/// <param name="c">The char prefix.</param>
/// <param name="argPos">References where the command starts.</param>
/// <returns>
/// <c>true</c> if the message begins with the char <paramref name="c"/>; otherwise <c>false</c>.
/// <see langword="true" /> if the message begins with the char <paramref name="c"/>; otherwise <see langword="false" />.
/// </returns>
public static bool HasCharPrefix(this IUserMessage msg, char c, ref int argPos)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Discord.Net.Commands/ModuleBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public abstract class ModuleBase<T> : IModuleBase
/// <param name="embed">An embed to be displayed alongside the <paramref name="message"/>.</param>
/// <param name="allowedMentions">
/// Specifies if notifications are sent for mentioned users and roles in the <paramref name="message"/>.
/// If <c>null</c>, all mentioned roles and users will be notified.
/// If <see langword="null" />, all mentioned roles and users will be notified.
/// </param>
/// <param name="options">The request options for this <see langword="async"/> request.</param>
/// <param name="messageReference">The message references to be included. Used to reply to specific messages.</param>
Expand Down
2 changes: 1 addition & 1 deletion src/Discord.Net.Commands/Results/ExecuteResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public static ExecuteResult FromError(IResult result)
/// Gets a string that indicates the execution result.
/// </summary>
/// <returns>
/// <c>Success</c> if <see cref="IsSuccess"/> is <c>true</c>; otherwise "<see cref="Error"/>:
/// <c>Success</c> if <see cref="IsSuccess"/> is <see langword="true" />; otherwise "<see cref="Error"/>:
/// <see cref="ErrorReason"/>".
/// </returns>
public override string ToString() => IsSuccess ? "Success" : $"{Error}: {ErrorReason}";
Expand Down
4 changes: 2 additions & 2 deletions src/Discord.Net.Commands/Results/IResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public interface IResult
/// </summary>
/// <returns>
/// A <see cref="CommandError" /> indicating the type of error that may have occurred during the operation;
/// <c>null</c> if the operation was successful.
/// <see langword="null" /> if the operation was successful.
/// </returns>
CommandError? Error { get; }
/// <summary>
Expand All @@ -24,7 +24,7 @@ public interface IResult
/// Indicates whether the operation was successful or not.
/// </summary>
/// <returns>
/// <c>true</c> if the result is positive; otherwise <c>false</c>.
/// <see langword="true" /> if the result is positive; otherwise <see langword="false" />.
/// </returns>
bool IsSuccess { get; }
}
Expand Down
2 changes: 1 addition & 1 deletion src/Discord.Net.Commands/Results/ParseResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public struct ParseResult : IResult
/// </summary>
/// <returns>
/// A <see cref="ParameterInfo" /> indicating the parameter info of the error that may have occurred during parsing;
/// <c>null</c> if the parsing was successful or the parsing error is not specific to a single parameter.
/// <see langword="null" /> if the parsing was successful or the parsing error is not specific to a single parameter.
/// </returns>
public ParameterInfo ErrorParameter { get; }

Expand Down
2 changes: 1 addition & 1 deletion src/Discord.Net.Commands/Results/RuntimeResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public abstract class RuntimeResult : IResult
/// <summary>
/// Initializes a new <see cref="RuntimeResult" /> class with the type of error and reason.
/// </summary>
/// <param name="error">The type of failure, or <c>null</c> if none.</param>
/// <param name="error">The type of failure, or <see langword="null" /> if none.</param>
/// <param name="reason">The reason of failure.</param>
protected RuntimeResult(CommandError? error, string reason)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Discord.Net.Core/DiscordConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public class DiscordConfig
/// Gets or sets whether the initial log entry should be printed.
/// </summary>
/// <remarks>
/// If set to <c>true</c>, the library will attempt to print the current version of the library, as well as
/// If set to <see langword="true" />, the library will attempt to print the current version of the library, as well as
/// the API version it uses on startup.
/// </remarks>
internal bool DisplayInitialLog { get; set; } = true;
Expand All @@ -179,7 +179,7 @@ public class DiscordConfig
/// Gets or sets whether or not rate-limits should use the system clock.
/// </summary>
/// <remarks>
/// If set to <c>false</c>, we will use the X-RateLimit-Reset-After header
/// If set to <see langword="false" />, we will use the X-RateLimit-Reset-After header
/// to determine when a rate-limit expires, rather than comparing the
/// X-RateLimit-Reset timestamp to the system time.
///
Expand Down
2 changes: 1 addition & 1 deletion src/Discord.Net.Core/Entities/Activities/GameAsset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ internal GameAsset() { }
/// <param name="size">The size of the image to return in. This can be any power of two between 16 and 2048.</param>
/// <param name="format">The format to return.</param>
/// <returns>
/// A string pointing to the image URL of the asset; <c>null</c> when the application ID does not exist.
/// A string pointing to the image URL of the asset; <see langword="null" /> when the application ID does not exist.
/// </returns>
public string GetImageUrl(ImageFormat format = ImageFormat.Auto, ushort size = 128)
=> ApplicationId.HasValue ? CDN.GetRichAssetUrl(ApplicationId.Value, ImageId, size, format) : null;
Expand Down
4 changes: 2 additions & 2 deletions src/Discord.Net.Core/Entities/AuditLogs/IAuditLogEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public interface IAuditLogEntry : ISnowflakeEntity
/// Gets the data for this entry.
/// </summary>
/// <returns>
/// An <see cref="IAuditLogData" /> for this audit log entry; <c>null</c> if no data is available.
/// An <see cref="IAuditLogData" /> for this audit log entry; <see langword="null" /> if no data is available.
/// </returns>
IAuditLogData Data { get; }

Expand All @@ -39,7 +39,7 @@ public interface IAuditLogEntry : ISnowflakeEntity
/// Gets the reason behind the change.
/// </summary>
/// <returns>
/// A string containing the reason for the change; <c>null</c> if none is provided.
/// A string containing the reason for the change; <see langword="null" /> if none is provided.
/// </returns>
string Reason { get; }
}
Expand Down
2 changes: 1 addition & 1 deletion src/Discord.Net.Core/Entities/Channels/IChannel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public interface IChannel : ISnowflakeEntity
/// <param name="options">The options to be used when sending the request.</param>
/// <returns>
/// A task that represents the asynchronous get operation. The task result contains a user object that
/// represents the found user; <c>null</c> if none is found.
/// represents the found user; <see langword="null" /> if none is found.
/// </returns>
Task<IUser> GetUserAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null);
}
Expand Down
14 changes: 7 additions & 7 deletions src/Discord.Net.Core/Entities/Channels/IForumChannel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ public interface IForumChannel : IMentionable, INestedChannel, IIntegrationChann
/// Gets a value that indicates whether the channel is NSFW.
/// </summary>
/// <returns>
/// <c>true</c> if the channel has the NSFW flag enabled; otherwise <c>false</c>.
/// <see langword="true" /> if the channel has the NSFW flag enabled; otherwise <see langword="false" />.
/// </returns>
bool IsNsfw { get; }

/// <summary>
/// Gets the current topic for this text channel.
/// </summary>
/// <returns>
/// A string representing the topic set in the channel; <c>null</c> if none is set.
/// A string representing the topic set in the channel; <see langword="null" /> if none is set.
/// </returns>
string Topic { get; }

Expand Down Expand Up @@ -103,7 +103,7 @@ public interface IForumChannel : IMentionable, INestedChannel, IIntegrationChann
/// <param name="options">The options to be used when sending the request.</param>
/// <param name="allowedMentions">
/// Specifies if notifications are sent for mentioned users and roles in the message <paramref name="text"/>.
/// If <c>null</c>, all mentioned roles and users will be notified.
/// If <see langword="null" />, all mentioned roles and users will be notified.
/// </param>
/// <param name="components">The message components to be included with this message. Used for interactions.</param>
/// <param name="stickers">A collection of stickers to send with the message.</param>
Expand All @@ -130,7 +130,7 @@ Task<IThreadChannel> CreatePostAsync(string title, ThreadArchiveDuration archive
/// <param name="isSpoiler">Whether the message attachment should be hidden as a spoiler.</param>
/// <param name="allowedMentions">
/// Specifies if notifications are sent for mentioned users and roles in the message <paramref name="text"/>.
/// If <c>null</c>, all mentioned roles and users will be notified.
/// If <see langword="null" />, all mentioned roles and users will be notified.
/// </param>
/// <param name="components">The message components to be included with this message. Used for interactions.</param>
/// <param name="stickers">A collection of stickers to send with the file.</param>
Expand Down Expand Up @@ -159,7 +159,7 @@ Task<IThreadChannel> CreatePostWithFileAsync(string title, string filePath, Thre
/// <param name="isSpoiler">Whether the message attachment should be hidden as a spoiler.</param>
/// <param name="allowedMentions">
/// Specifies if notifications are sent for mentioned users and roles in the message <paramref name="text"/>.
/// If <c>null</c>, all mentioned roles and users will be notified.
/// If <see langword="null" />, all mentioned roles and users will be notified.
/// </param>
/// <param name="components">The message components to be included with this message. Used for interactions.</param>
/// <param name="stickers">A collection of stickers to send with the file.</param>
Expand All @@ -186,7 +186,7 @@ public Task<IThreadChannel> CreatePostWithFileAsync(string title, Stream stream,
/// <param name="options">The options to be used when sending the request.</param>
/// <param name="allowedMentions">
/// Specifies if notifications are sent for mentioned users and roles in the message <paramref name="text"/>.
/// If <c>null</c>, all mentioned roles and users will be notified.
/// If <see langword="null" />, all mentioned roles and users will be notified.
/// </param>
/// <param name="components">The message components to be included with this message. Used for interactions.</param>
/// <param name="stickers">A collection of stickers to send with the file.</param>
Expand All @@ -212,7 +212,7 @@ public Task<IThreadChannel> CreatePostWithFileAsync(string title, FileAttachment
/// <param name="options">The options to be used when sending the request.</param>
/// <param name="allowedMentions">
/// Specifies if notifications are sent for mentioned users and roles in the message <paramref name="text"/>.
/// If <c>null</c>, all mentioned roles and users will be notified.
/// If <see langword="null" />, all mentioned roles and users will be notified.
/// </param>
/// <param name="components">The message components to be included with this message. Used for interactions.</param>
/// <param name="stickers">A collection of stickers to send with the file.</param>
Expand Down
6 changes: 3 additions & 3 deletions src/Discord.Net.Core/Entities/Channels/IGuildChannel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,15 @@ public interface IGuildChannel : IChannel, IDeletable
/// </summary>
/// <param name="role">The role to get the overwrite from.</param>
/// <returns>
/// An overwrite object for the targeted role; <c>null</c> if none is set.
/// An overwrite object for the targeted role; <see langword="null" /> if none is set.
/// </returns>
OverwritePermissions? GetPermissionOverwrite(IRole role);
/// <summary>
/// Gets the permission overwrite for a specific user.
/// </summary>
/// <param name="user">The user to get the overwrite from.</param>
/// <returns>
/// An overwrite object for the targeted user; <c>null</c> if none is set.
/// An overwrite object for the targeted user; <see langword="null" /> if none is set.
/// </returns>
OverwritePermissions? GetPermissionOverwrite(IUser user);
/// <summary>
Expand Down Expand Up @@ -163,7 +163,7 @@ public interface IGuildChannel : IChannel, IDeletable
/// <param name="options">The options to be used when sending the request.</param>
/// <returns>
/// A task representing the asynchronous get operation. The task result contains a guild user object that
/// represents the user; <c>null</c> if none is found.
/// represents the user; <see langword="null" /> if none is found.
/// </returns>
new Task<IGuildUser> GetUserAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public interface IIntegrationChannel : IGuildChannel
/// <param name="options">The options to be used when sending the request.</param>
/// <returns>
/// A task that represents the asynchronous get operation. The task result contains a webhook associated
/// with the identifier; <c>null</c> if the webhook is not found.
/// with the identifier; <see langword="null" /> if the webhook is not found.
/// </returns>
Task<IWebhook> GetWebhookAsync(ulong id, RequestOptions options = null);

Expand Down
Loading

0 comments on commit 9ddd922

Please sign in to comment.