[Refactor] Refactor some stuff (#2688)

* fix some `internal` classes being exposed

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

* bump library version in samples

* fix possible oversight
This commit is contained in:
Misha133
2023-06-27 17:11:16 +03:00
committed by GitHub
parent fe4130df45
commit 9ddd922d2f
119 changed files with 326 additions and 324 deletions

View File

@@ -2,7 +2,7 @@ using Discord.Rest;
namespace Discord.API.AuditLogs;
public class GuildInfoAuditLogModel : IAuditLogInfoModel
internal class GuildInfoAuditLogModel : IAuditLogInfoModel
{
[JsonField("name")]
public string Name { get; set; }

View File

@@ -2,7 +2,7 @@ using Newtonsoft.Json;
namespace Discord.API;
public class ForumReactionEmoji
internal class ForumReactionEmoji
{
[JsonProperty("emoji_id")]
public ulong? EmojiId { get; set; }

View File

@@ -5,7 +5,7 @@ namespace Discord.API
/// <summary>
/// Represents a vanity invite.
/// </summary>
public class InviteVanity
internal class InviteVanity
{
/// <summary>
/// The unique code for the invite link.

View File

@@ -7,7 +7,7 @@ using System.Threading.Tasks;
namespace Discord.API
{
public class MessageActivity
internal class MessageActivity
{
[JsonProperty("type")]
public Optional<MessageActivityType> Type { get; set; }

View File

@@ -7,7 +7,7 @@ using System.Threading.Tasks;
namespace Discord.API
{
public class MessageApplication
internal class MessageApplication
{
/// <summary>
/// Gets the snowflake ID of the application.

View File

@@ -3,7 +3,7 @@ using System.Collections.Generic;
namespace Discord.API;
public class RoleConnection
internal class RoleConnection
{
[JsonProperty("platform_name")]
public Optional<string> PlatformName { get; set; }

View File

@@ -3,7 +3,7 @@ using System.Collections.Generic;
namespace Discord.API;
public class RoleConnectionMetadata
internal class RoleConnectionMetadata
{
[JsonProperty("type")]
public RoleConnectionMetadataType Type { get; set; }

View File

@@ -46,7 +46,7 @@ namespace Discord.API.Rest
[JsonProperty("default_sort_order")]
public Optional<ForumSortOrder?> DefaultSortOrder { get; set; }
[JsonProperty("default_forum_layout ")]
[JsonProperty("default_forum_layout")]
public Optional<ForumLayout> DefaultLayout { get; set; }
public CreateGuildChannelParams(string name, ChannelType type)

View File

@@ -3,7 +3,7 @@ using Newtonsoft.Json;
namespace Discord.API;
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
public class ModifyForumReactionEmojiParams
internal class ModifyForumReactionEmojiParams
{
[JsonProperty("emoji_id")]
public Optional<ulong?> EmojiId { get; set; }

View File

@@ -1471,7 +1471,8 @@ namespace Discord.API
{
if ((!args.Embeds.IsSpecified || args.Embeds.Value == null || args.Embeds.Value.Length == 0)
&& (!args.Content.IsSpecified || args.Content.Value is null || string.IsNullOrWhiteSpace(args.Content.Value))
&& (!args.Components.IsSpecified || args.Components.Value is null || args.Components.Value.Length == 0))
&& (!args.Components.IsSpecified || args.Components.Value is null || args.Components.Value.Length == 0)
&& (!args.File.IsSpecified))
{
throw new ArgumentException("At least one of 'Content', 'Embeds', 'File' or 'Components' must be specified.", nameof(args));
}
@@ -1494,7 +1495,8 @@ namespace Discord.API
{
if ((!args.Embeds.IsSpecified || args.Embeds.Value == null || args.Embeds.Value.Length == 0)
&& (!args.Content.IsSpecified || args.Content.Value is null || string.IsNullOrWhiteSpace(args.Content.Value))
&& (!args.MessageComponents.IsSpecified || args.MessageComponents.Value is null || args.MessageComponents.Value.Length == 0))
&& (!args.MessageComponents.IsSpecified || args.MessageComponents.Value is null || args.MessageComponents.Value.Length == 0)
&& (args.Files.Length == 0))
{
throw new ArgumentException("At least one of 'Content', 'Embeds', 'Files' or 'Components' must be specified.", nameof(args));
}

View File

@@ -92,7 +92,7 @@ public class ChannelCreateAuditLogData : IAuditLogData
/// <returns>
/// An <see cref="int"/> representing the time in seconds required before the user can send another
/// message; <c>0</c> if disabled.
/// <c>null</c> if this is not mentioned in this entry.
/// <see langword="null" /> if this is not mentioned in this entry.
/// </returns>
public int? SlowModeInterval { get; }
@@ -100,8 +100,8 @@ public class ChannelCreateAuditLogData : IAuditLogData
/// Gets the value that indicates whether the created channel is NSFW.
/// </summary>
/// <returns>
/// <c>true</c> if the created channel has the NSFW flag enabled; otherwise <c>false</c>.
/// <c>null</c> if this is not mentioned in this entry.
/// <see langword="true" /> if the created channel has the NSFW flag enabled; otherwise <see langword="false" />.
/// <see langword="null" /> if this is not mentioned in this entry.
/// </returns>
public bool? IsNsfw { get; }
@@ -111,7 +111,7 @@ public class ChannelCreateAuditLogData : IAuditLogData
/// <returns>
/// An <see cref="int"/> representing the bit-rate (bps) that the created voice channel defines and requests the
/// client(s) to use.
/// <c>null</c> if this is not mentioned in this entry.
/// <see langword="null" /> if this is not mentioned in this entry.
/// </returns>
public int? Bitrate { get; }

View File

@@ -93,15 +93,15 @@ public class ChannelDeleteAuditLogData : IAuditLogData
/// <returns>
/// An <see cref="int"/> representing the time in seconds required before the user can send another
/// message; <c>0</c> if disabled.
/// <c>null</c> if this is not mentioned in this entry.
/// <see langword="null" /> if this is not mentioned in this entry.
/// </returns>
public int? SlowModeInterval { get; }
/// <summary>
/// Gets the value that indicates whether the deleted channel was NSFW.
/// </summary>
/// <returns>
/// <c>true</c> if this channel had the NSFW flag enabled; otherwise <c>false</c>.
/// <c>null</c> if this is not mentioned in this entry.
/// <see langword="true" /> if this channel had the NSFW flag enabled; otherwise <see langword="false" />.
/// <see langword="null" /> if this is not mentioned in this entry.
/// </returns>
public bool? IsNsfw { get; }
/// <summary>
@@ -109,7 +109,7 @@ public class ChannelDeleteAuditLogData : IAuditLogData
/// </summary>
/// <returns>
/// An <see cref="int"/> representing the bit-rate set of the voice channel.
/// <c>null</c> if this is not mentioned in this entry.
/// <see langword="null" /> if this is not mentioned in this entry.
/// </returns>
public int? Bitrate { get; }
/// <summary>

View File

@@ -67,15 +67,15 @@ namespace Discord.Rest
/// <returns>
/// An <see cref="int"/> representing the time in seconds required before the user can send another
/// message; <c>0</c> if disabled.
/// <c>null</c> if this is not mentioned in this entry.
/// <see langword="null" /> if this is not mentioned in this entry.
/// </returns>
public int? SlowModeInterval { get; }
/// <summary>
/// Gets the value that indicates whether this channel is NSFW.
/// </summary>
/// <returns>
/// <c>true</c> if this channel has the NSFW flag enabled; otherwise <c>false</c>.
/// <c>null</c> if this is not mentioned in this entry.
/// <see langword="true" /> if this channel has the NSFW flag enabled; otherwise <see langword="false" />.
/// <see langword="null" /> if this is not mentioned in this entry.
/// </returns>
public bool? IsNsfw { get; }
/// <summary>
@@ -83,14 +83,14 @@ namespace Discord.Rest
/// </summary>
/// <returns>
/// An <see cref="int"/> representing the bit-rate set for the voice channel;
/// <c>null</c> if this is not mentioned in this entry.
/// <see langword="null" /> if this is not mentioned in this entry.
/// </returns>
public int? Bitrate { get; }
/// <summary>
/// Gets the type of this channel.
/// </summary>
/// <returns>
/// The channel type of this channel; <c>null</c> if not applicable.
/// The channel type of this channel; <see langword="null" /> if not applicable.
/// </returns>
public ChannelType? ChannelType { get; }

View File

@@ -123,7 +123,7 @@ public struct GuildInfo
/// <returns>
/// An <see cref="int"/> representing the amount of time in seconds for a user to be marked as inactive
/// and moved into the AFK voice channel.
/// <c>null</c> if this is not mentioned in this entry.
/// <see langword="null" /> if this is not mentioned in this entry.
/// </returns>
public int? AfkTimeout { get; }
/// <summary>
@@ -131,14 +131,14 @@ public struct GuildInfo
/// </summary>
/// <returns>
/// The default message notifications setting of this guild.
/// <c>null</c> if this is not mentioned in this entry.
/// <see langword="null" /> if this is not mentioned in this entry.
/// </returns>
public DefaultMessageNotifications? DefaultMessageNotifications { get; }
/// <summary>
/// Gets the ID of the AFK voice channel for this guild.
/// </summary>
/// <returns>
/// A <see cref="ulong"/> representing the snowflake identifier of the AFK voice channel; <c>null</c> if
/// A <see cref="ulong"/> representing the snowflake identifier of the AFK voice channel; <see langword="null" /> if
/// none is set.
/// </returns>
public ulong? AfkChannelId { get; }
@@ -157,7 +157,7 @@ public struct GuildInfo
/// Gets the ID of this guild's icon.
/// </summary>
/// <returns>
/// A string containing the identifier for the splash image; <c>null</c> if none is set.
/// A string containing the identifier for the splash image; <see langword="null" /> if none is set.
/// </returns>
public string IconHash { get; }
/// <summary>
@@ -165,7 +165,7 @@ public struct GuildInfo
/// </summary>
/// <returns>
/// The level of requirements.
/// <c>null</c> if this is not mentioned in this entry.
/// <see langword="null" /> if this is not mentioned in this entry.
/// </returns>
public VerificationLevel? VerificationLevel { get; }
/// <summary>
@@ -181,7 +181,7 @@ public struct GuildInfo
/// </summary>
/// <returns>
/// The level of MFA requirement.
/// <c>null</c> if this is not mentioned in this entry.
/// <see langword="null" /> if this is not mentioned in this entry.
/// </returns>
public MfaLevel? MfaLevel { get; }
/// <summary>
@@ -196,7 +196,7 @@ public struct GuildInfo
/// </summary>
/// <returns>
/// A <see cref="ulong"/> representing the snowflake identifier of the channel where system
/// messages are sent; <c>null</c> if none is set.
/// messages are sent; <see langword="null" /> if none is set.
/// </returns>
public ulong? SystemChannelId { get; }
/// <summary>
@@ -204,15 +204,15 @@ public struct GuildInfo
/// </summary>
/// <returns>
/// A <see cref="ulong"/> representing the snowflake identifier of the embedded channel found within the
/// widget settings of this guild; <c>null</c> if none is set.
/// widget settings of this guild; <see langword="null" /> if none is set.
/// </returns>
public ulong? EmbedChannelId { get; }
/// <summary>
/// Gets a value that indicates whether this guild is embeddable (i.e. can use widget).
/// </summary>
/// <returns>
/// <c>true</c> if this guild can be embedded via widgets; otherwise <c>false</c>.
/// <c>null</c> if this is not mentioned in this entry.
/// <see langword="true" /> if this guild can be embedded via widgets; otherwise <see langword="false" />.
/// <see langword="null" /> if this is not mentioned in this entry.
/// </returns>
public bool? IsEmbeddable { get; }
}

View File

@@ -59,8 +59,8 @@ public class InviteCreateAuditLogData : IAuditLogData
/// Gets a value that determines whether the invite is a temporary one.
/// </summary>
/// <returns>
/// <c>true</c> if users accepting this invite will be removed from the guild when they log off; otherwise
/// <c>false</c>.
/// <see langword="true" /> if users accepting this invite will be removed from the guild when they log off; otherwise
/// <see langword="false" />.
/// </returns>
public bool Temporary { get; }
@@ -96,7 +96,7 @@ public class InviteCreateAuditLogData : IAuditLogData
/// </summary>
/// <returns>
/// An <see cref="int"/> representing the number of uses this invite may be accepted until it is removed
/// from the guild; <c>null</c> if none is set.
/// from the guild; <see langword="null" /> if none is set.
/// </returns>
public int MaxUses { get; }
}

View File

@@ -59,8 +59,8 @@ public class InviteDeleteAuditLogData : IAuditLogData
/// Gets a value that indicates whether the invite is a temporary one.
/// </summary>
/// <returns>
/// <c>true</c> if users accepting this invite will be removed from the guild when they log off; otherwise
/// <c>false</c>.
/// <see langword="true" /> if users accepting this invite will be removed from the guild when they log off; otherwise
/// <see langword="false" />.
/// </returns>
public bool Temporary { get; }
@@ -96,7 +96,7 @@ public class InviteDeleteAuditLogData : IAuditLogData
/// </summary>
/// <returns>
/// An <see cref="int"/> representing the number of uses this invite may be accepted until it is removed
/// from the guild; <c>null</c> if none is set.
/// from the guild; <see langword="null" /> if none is set.
/// </returns>
public int MaxUses { get; }
}

View File

@@ -21,7 +21,7 @@ public struct InviteInfo
/// Gets the time (in seconds) until the invite expires.
/// </summary>
/// <returns>
/// An <see cref="int"/> representing the time in seconds until this invite expires; <c>null</c> if this
/// An <see cref="int"/> representing the time in seconds until this invite expires; <see langword="null" /> if this
/// invite never expires or not specified.
/// </returns>
public int? MaxAge { get; }
@@ -38,8 +38,8 @@ public struct InviteInfo
/// Gets a value that indicates whether the invite is a temporary one.
/// </summary>
/// <returns>
/// <c>true</c> if users accepting this invite will be removed from the guild when they log off,
/// <c>false</c> if not; <c>null</c> if not specified.
/// <see langword="true" /> if users accepting this invite will be removed from the guild when they log off,
/// <see langword="false" /> if not; <see langword="null" /> if not specified.
/// </returns>
public bool? Temporary { get; }
@@ -48,7 +48,7 @@ public struct InviteInfo
/// </summary>
/// <returns>
/// A <see cref="ulong"/> representing the channel snowflake identifier that the invite points to;
/// <c>null</c> if not specified.
/// <see langword="null" /> if not specified.
/// </returns>
public ulong? ChannelId { get; }
@@ -57,7 +57,7 @@ public struct InviteInfo
/// </summary>
/// <returns>
/// An <see cref="int"/> representing the number of uses this invite may be accepted until it is removed
/// from the guild; <c>null</c> if none is specified.
/// from the guild; <see langword="null" /> if none is specified.
/// </returns>
public int? MaxUses { get; }

View File

@@ -32,7 +32,7 @@ public struct MemberRoleEditInfo
/// Gets a value that indicates whether the role was added to the user.
/// </summary>
/// <returns>
/// <c>true</c> if the role was added to the user; otherwise <c>false</c>.
/// <see langword="true" /> if the role was added to the user; otherwise <see langword="false" />.
/// </returns>
public bool Added { get; }
}

View File

@@ -30,7 +30,7 @@ public struct RoleEditInfo
/// Gets the color of this role.
/// </summary>
/// <returns>
/// A color object representing the color assigned to this role; <c>null</c> if this role does not have a
/// A color object representing the color assigned to this role; <see langword="null" /> if this role does not have a
/// color.
/// </returns>
public Color? Color { get; }
@@ -39,8 +39,8 @@ public struct RoleEditInfo
/// Gets a value that indicates whether this role is mentionable.
/// </summary>
/// <returns>
/// <c>true</c> if other members can mention this role in a text channel; otherwise <c>false</c>;
/// <c>null</c> if this is not mentioned in this entry.
/// <see langword="true" /> if other members can mention this role in a text channel; otherwise <see langword="false" />;
/// <see langword="null" /> if this is not mentioned in this entry.
/// </returns>
public bool? Mentionable { get; }
@@ -49,8 +49,8 @@ public struct RoleEditInfo
/// section on the user list).
/// </summary>
/// <returns>
/// <c>true</c> if this role's members will appear in a separate section in the user list; otherwise
/// <c>false</c>; <c>null</c> if this is not mentioned in this entry.
/// <see langword="true" /> if this role's members will appear in a separate section in the user list; otherwise
/// <see langword="false" />; <see langword="null" /> if this is not mentioned in this entry.
/// </returns>
public bool? Hoist { get; }
@@ -66,7 +66,7 @@ public struct RoleEditInfo
/// Gets the permissions assigned to this role.
/// </summary>
/// <returns>
/// A guild permissions object representing the permissions that have been assigned to this role; <c>null</c>
/// A guild permissions object representing the permissions that have been assigned to this role; <see langword="null" />
/// if no permissions have been assigned.
/// </returns>
public GuildPermissions? Permissions { get; }

View File

@@ -43,7 +43,7 @@ public class ThreadCreateAuditLogData : IAuditLogData
/// Gets the thread that was created if it still exists.
/// </summary>
/// <returns>
/// A thread object representing the thread that was created if it still exists, otherwise returns <c>null</c>.
/// A thread object representing the thread that was created if it still exists, otherwise returns <see langword="null" />.
/// </returns>
public IThreadChannel Thread { get; }
@@ -75,7 +75,7 @@ public class ThreadCreateAuditLogData : IAuditLogData
/// Gets the value that indicates whether the thread is archived.
/// </summary>
/// <returns>
/// <c>true</c> if this thread has the Archived flag enabled; otherwise <c>false</c>.
/// <see langword="true" /> if this thread has the Archived flag enabled; otherwise <see langword="false" />.
/// </returns>
public bool IsArchived { get; }
@@ -91,7 +91,7 @@ public class ThreadCreateAuditLogData : IAuditLogData
/// Gets the value that indicates whether the thread is locked.
/// </summary>
/// <returns>
/// <c>true</c> if this thread has the Locked flag enabled; otherwise <c>false</c>.
/// <see langword="true" /> if this thread has the Locked flag enabled; otherwise <see langword="false" />.
/// </returns>
public bool IsLocked { get; }
@@ -101,7 +101,7 @@ public class ThreadCreateAuditLogData : IAuditLogData
/// <returns>
/// An <see cref="int"/> representing the time in seconds required before the user can send another
/// message; <c>0</c> if disabled.
/// <c>null</c> if this is not mentioned in this entry.
/// <see langword="null" /> if this is not mentioned in this entry.
/// </returns>
public int? SlowModeInterval { get; }

View File

@@ -63,7 +63,7 @@ public class ThreadDeleteAuditLogData : IAuditLogData
/// Gets the value that indicates whether the deleted thread was archived.
/// </summary>
/// <returns>
/// <c>true</c> if this thread had the Archived flag enabled; otherwise <c>false</c>.
/// <see langword="true" /> if this thread had the Archived flag enabled; otherwise <see langword="false" />.
/// </returns>
public bool IsArchived { get; }
@@ -79,7 +79,7 @@ public class ThreadDeleteAuditLogData : IAuditLogData
/// Gets the value that indicates whether the deleted thread was locked.
/// </summary>
/// <returns>
/// <c>true</c> if this thread had the Locked flag enabled; otherwise <c>false</c>.
/// <see langword="true" /> if this thread had the Locked flag enabled; otherwise <see langword="false" />.
/// </returns>
public bool IsLocked { get; }
@@ -89,7 +89,7 @@ public class ThreadDeleteAuditLogData : IAuditLogData
/// <returns>
/// An <see cref="int"/> representing the time in seconds required before the user can send another
/// message; <c>0</c> if disabled.
/// <c>null</c> if this is not mentioned in this entry.
/// <see langword="null" /> if this is not mentioned in this entry.
/// </returns>
public int? SlowModeInterval { get; }

View File

@@ -37,7 +37,7 @@ public class ThreadUpdateAuditLogData : IAuditLogData
/// Gets the thread that was created if it still exists.
/// </summary>
/// <returns>
/// A thread object representing the thread that was created if it still exists, otherwise returns <c>null</c>.
/// A thread object representing the thread that was created if it still exists, otherwise returns <see langword="null" />.
/// </returns>
public IThreadChannel Thread { get; }

View File

@@ -39,7 +39,7 @@ public class WebhookCreateAuditLogData : IAuditLogData
/// Gets the webhook that was created if it still exists.
/// </summary>
/// <returns>
/// A webhook object representing the webhook that was created if it still exists, otherwise returns <c>null</c>.
/// A webhook object representing the webhook that was created if it still exists, otherwise returns <see langword="null" />.
/// </returns>
public IWebhook Webhook { get; }

View File

@@ -329,7 +329,7 @@ namespace Discord.Rest
/// invalid characters as defined by <see cref="System.IO.Path.GetInvalidPathChars"/>.
/// </exception>
/// <exception cref="ArgumentNullException">
/// <paramref name="filePath" /> is <c>null</c>.
/// <paramref name="filePath" /> is <see langword="null" />.
/// </exception>
/// <exception cref="PathTooLongException">
/// The specified path, file name, or both exceed the system-defined maximum length. For example, on

View File

@@ -35,7 +35,7 @@ namespace Discord.Rest
/// <param name="options">The options to be used when sending the request.</param>
/// <returns>
/// A task that represents an asynchronous get operation for retrieving the message. The task result contains
/// the retrieved message; <c>null</c> if no message is found with the specified identifier.
/// the retrieved message; <see langword="null" /> if no message is found with the specified identifier.
/// </returns>
Task<RestMessage> GetMessageAsync(ulong id, RequestOptions options = null);
/// <summary>

View File

@@ -64,7 +64,7 @@ namespace Discord.Rest
/// </summary>
/// <param name="id">The snowflake identifier of the user.</param>
/// <returns>
/// A <see cref="RestUser"/> object that is a recipient of this channel; otherwise <c>null</c>.
/// A <see cref="RestUser"/> object that is a recipient of this channel; otherwise <see langword="null" />.
/// </returns>
public RestUser GetUser(ulong id)
{
@@ -107,7 +107,7 @@ namespace Discord.Rest
/// invalid characters as defined by <see cref="System.IO.Path.GetInvalidPathChars"/>.
/// </exception>
/// <exception cref="ArgumentNullException">
/// <paramref name="filePath" /> is <c>null</c>.
/// <paramref name="filePath" /> is <see langword="null" />.
/// </exception>
/// <exception cref="PathTooLongException">
/// The specified path, file name, or both exceed the system-defined maximum length. For example, on

View File

@@ -117,7 +117,7 @@ namespace Discord.Rest
/// invalid characters as defined by <see cref="System.IO.Path.GetInvalidPathChars"/>.
/// </exception>
/// <exception cref="ArgumentNullException">
/// <paramref name="filePath" /> is <c>null</c>.
/// <paramref name="filePath" /> is <see langword="null" />.
/// </exception>
/// <exception cref="PathTooLongException">
/// The specified path, file name, or both exceed the system-defined maximum length. For example, on

View File

@@ -90,7 +90,7 @@ namespace Discord.Rest
/// </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>
public virtual OverwritePermissions? GetPermissionOverwrite(IUser user)
{
@@ -107,7 +107,7 @@ namespace Discord.Rest
/// </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>
public virtual OverwritePermissions? GetPermissionOverwrite(IRole role)
{

View File

@@ -76,7 +76,7 @@ namespace Discord.Rest
/// </exception>
/// <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>
public Task<RestGuildUser> GetUserAsync(ulong id, RequestOptions options = null)
=> ChannelHelper.GetUserAsync(this, Guild, Discord, id, options);
@@ -127,7 +127,7 @@ namespace Discord.Rest
/// invalid characters as defined by <see cref="System.IO.Path.GetInvalidPathChars"/>.
/// </exception>
/// <exception cref="ArgumentNullException">
/// <paramref name="filePath" /> is <c>null</c>.
/// <paramref name="filePath" /> is <see langword="null" />.
/// </exception>
/// <exception cref="PathTooLongException">
/// The specified path, file name, or both exceed the system-defined maximum length. For example, on
@@ -227,7 +227,7 @@ namespace Discord.Rest
/// <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>
public virtual Task<RestWebhook> GetWebhookAsync(ulong id, RequestOptions options = null)
=> ChannelHelper.GetWebhookAsync(this, Discord, id, options);
@@ -280,7 +280,7 @@ namespace Discord.Rest
/// <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 the category channel
/// representing the parent of this channel; <c>null</c> if none is set.
/// representing the parent of this channel; <see langword="null" /> if none is set.
/// </returns>
public virtual Task<ICategoryChannel> GetCategoryAsync(RequestOptions options = null)
=> ChannelHelper.GetCategoryAsync(this, Discord, options);

View File

@@ -16,7 +16,7 @@ namespace Discord.Rest
internal static class GuildHelper
{
#region General
/// <exception cref="ArgumentNullException"><paramref name="func"/> is <c>null</c>.</exception>
/// <exception cref="ArgumentNullException"><paramref name="func"/> is <see langword="null" />.</exception>
public static async Task<Model> ModifyAsync(IGuild guild, BaseDiscordClient client,
Action<GuildProperties> func, RequestOptions options)
{
@@ -90,7 +90,7 @@ namespace Discord.Rest
return await client.ApiClient.ModifyGuildAsync(guild.Id, apiArgs, options).ConfigureAwait(false);
}
/// <exception cref="ArgumentNullException"><paramref name="func"/> is <c>null</c>.</exception>
/// <exception cref="ArgumentNullException"><paramref name="func"/> is <see langword="null" />.</exception>
public static async Task<WidgetModel> ModifyWidgetAsync(IGuild guild, BaseDiscordClient client,
Action<GuildWidgetProperties> func, RequestOptions options)
{
@@ -230,7 +230,7 @@ namespace Discord.Rest
var models = await client.ApiClient.GetGuildChannelsAsync(guild.Id, options).ConfigureAwait(false);
return models.Select(x => RestGuildChannel.Create(client, guild, x)).ToImmutableArray();
}
/// <exception cref="ArgumentNullException"><paramref name="name"/> is <c>null</c>.</exception>
/// <exception cref="ArgumentNullException"><paramref name="name"/> is <see langword="null" />.</exception>
public static async Task<RestTextChannel> CreateTextChannelAsync(IGuild guild, BaseDiscordClient client,
string name, RequestOptions options, Action<TextChannelProperties> func = null)
{
@@ -261,7 +261,7 @@ namespace Discord.Rest
var model = await client.ApiClient.CreateGuildChannelAsync(guild.Id, args, options).ConfigureAwait(false);
return RestTextChannel.Create(client, guild, model);
}
/// <exception cref="ArgumentNullException"><paramref name="name"/> is <c>null</c>.</exception>
/// <exception cref="ArgumentNullException"><paramref name="name"/> is <see langword="null" />.</exception>
public static async Task<RestVoiceChannel> CreateVoiceChannelAsync(IGuild guild, BaseDiscordClient client,
string name, RequestOptions options, Action<VoiceChannelProperties> func = null)
{
@@ -320,7 +320,7 @@ namespace Discord.Rest
var model = await client.ApiClient.CreateGuildChannelAsync(guild.Id, args, options).ConfigureAwait(false);
return RestStageChannel.Create(client, guild, model);
}
/// <exception cref="ArgumentNullException"><paramref name="name"/> is <c>null</c>.</exception>
/// <exception cref="ArgumentNullException"><paramref name="name"/> is <see langword="null" />.</exception>
public static async Task<RestCategoryChannel> CreateCategoryChannelAsync(IGuild guild, BaseDiscordClient client,
string name, RequestOptions options, Action<GuildChannelProperties> func = null)
{
@@ -348,7 +348,7 @@ namespace Discord.Rest
return RestCategoryChannel.Create(client, guild, model);
}
/// <exception cref="ArgumentNullException"><paramref name="name"/> is <c>null</c>.</exception>
/// <exception cref="ArgumentNullException"><paramref name="name"/> is <see langword="null" />.</exception>
public static async Task<RestForumChannel> CreateForumChannelAsync(IGuild guild, BaseDiscordClient client,
string name, RequestOptions options, Action<ForumChannelProperties> func = null)
{
@@ -466,7 +466,7 @@ namespace Discord.Rest
#endregion
#region Roles
/// <exception cref="ArgumentNullException"><paramref name="name"/> is <c>null</c>.</exception>
/// <exception cref="ArgumentNullException"><paramref name="name"/> is <see langword="null" />.</exception>
public static async Task<RestRole> CreateRoleAsync(IGuild guild, BaseDiscordClient client,
string name, GuildPermissions? permissions, Color? color, bool isHoisted, bool isMentionable, RequestOptions options)
{
@@ -685,7 +685,7 @@ namespace Discord.Rest
var emote = await client.ApiClient.CreateGuildEmoteAsync(guild.Id, apiargs, options).ConfigureAwait(false);
return emote.ToEntity();
}
/// <exception cref="ArgumentNullException"><paramref name="func"/> is <c>null</c>.</exception>
/// <exception cref="ArgumentNullException"><paramref name="func"/> is <see langword="null" />.</exception>
public static async Task<GuildEmote> ModifyEmoteAsync(IGuild guild, BaseDiscordClient client, ulong id, Action<EmoteProperties> func,
RequestOptions options)
{

View File

@@ -873,7 +873,7 @@ namespace Discord.Rest
/// This method removes all users that have not logged on in the provided number of <paramref name="days"/>.
/// </para>
/// <para>
/// If <paramref name="simulate" /> is <c>true</c>, this method will only return the number of users that
/// If <paramref name="simulate" /> is <see langword="true" />, this method will only return the number of users that
/// would be removed without kicking the users.
/// </para>
/// </remarks>