diff --git a/DisCatSharp.CommandsNext/CommandsNextExtension.cs b/DisCatSharp.CommandsNext/CommandsNextExtension.cs index e9447807ab..717168ad73 100644 --- a/DisCatSharp.CommandsNext/CommandsNextExtension.cs +++ b/DisCatSharp.CommandsNext/CommandsNextExtension.cs @@ -185,7 +185,7 @@ internal CommandsNextExtension(CommandsNextConfiguration cfg) /// DO NOT USE THIS MANUALLY. /// /// DO NOT USE THIS MANUALLY. - /// + /// protected internal override void Setup(DiscordClient client) { if (this.Client != null) diff --git a/DisCatSharp.Common/Attributes/DateTimeFormatAttribute.cs b/DisCatSharp.Common/Attributes/DateTimeFormatAttribute.cs index c2c2232d6d..adb5c3447e 100644 --- a/DisCatSharp.Common/Attributes/DateTimeFormatAttribute.cs +++ b/DisCatSharp.Common/Attributes/DateTimeFormatAttribute.cs @@ -26,7 +26,7 @@ namespace DisCatSharp.Common.Serialization; /// -/// Defines the format for string-serialized and objects. +/// Defines the format for string-serialized and objects. /// [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] public sealed class DateTimeFormatAttribute : SerializationAttribute @@ -90,7 +90,7 @@ public DateTimeFormatAttribute(string format) } /// -/// Defines which built-in format to use for for and serialization. +/// Defines which built-in format to use for for and serialization. /// See https://docs.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings and https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings for more details. /// public enum DateTimeFormatKind : int diff --git a/DisCatSharp.Common/Attributes/TimeSpanAttributes.cs b/DisCatSharp.Common/Attributes/TimeSpanAttributes.cs index af1e257edb..b5b123fbae 100644 --- a/DisCatSharp.Common/Attributes/TimeSpanAttributes.cs +++ b/DisCatSharp.Common/Attributes/TimeSpanAttributes.cs @@ -25,7 +25,7 @@ namespace DisCatSharp.Common.Serialization; /// -/// Specifies that this will be serialized as a number of whole seconds. +/// Specifies that this will be serialized as a number of whole seconds. /// This value will always be serialized as a number. /// [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] @@ -33,7 +33,7 @@ public sealed class TimeSpanSecondsAttribute : SerializationAttribute { } /// -/// Specifies that this will be serialized as a number of whole milliseconds. +/// Specifies that this will be serialized as a number of whole milliseconds. /// This value will always be serialized as a number. /// [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] diff --git a/DisCatSharp.Common/Attributes/TimeSpanFormatAttribute.cs b/DisCatSharp.Common/Attributes/TimeSpanFormatAttribute.cs index af570ce41f..8506149121 100644 --- a/DisCatSharp.Common/Attributes/TimeSpanFormatAttribute.cs +++ b/DisCatSharp.Common/Attributes/TimeSpanFormatAttribute.cs @@ -26,7 +26,7 @@ namespace DisCatSharp.Common.Serialization; /// -/// Defines the format for string-serialized objects. +/// Defines the format for string-serialized objects. /// [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] public sealed class TimeSpanFormatAttribute : SerializationAttribute @@ -90,7 +90,7 @@ public TimeSpanFormatAttribute(string format) } /// -/// Defines which built-in format to use for serialization. +/// Defines which built-in format to use for serialization. /// See https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-timespan-format-strings and https://docs.microsoft.com/en-us/dotnet/standard/base-types/custom-timespan-format-strings for more details. /// public enum TimeSpanFormatKind : int diff --git a/DisCatSharp.Common/Attributes/UnixTimestampAttributes.cs b/DisCatSharp.Common/Attributes/UnixTimestampAttributes.cs index cf3b9aed8d..32144740a8 100644 --- a/DisCatSharp.Common/Attributes/UnixTimestampAttributes.cs +++ b/DisCatSharp.Common/Attributes/UnixTimestampAttributes.cs @@ -25,7 +25,7 @@ namespace DisCatSharp.Common.Serialization; /// -/// Specifies that this or will be serialized as Unix timestamp seconds. +/// Specifies that this or will be serialized as Unix timestamp seconds. /// This value will always be serialized as a number. /// [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] @@ -33,7 +33,7 @@ public sealed class UnixSecondsAttribute : SerializationAttribute { } /// -/// Specifies that this or will be serialized as Unix timestamp milliseconds. +/// Specifies that this or will be serialized as Unix timestamp milliseconds. /// This value will always be serialized as a number. /// [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] diff --git a/DisCatSharp.Common/Types/CharSpanLookupDictionary.cs b/DisCatSharp.Common/Types/CharSpanLookupDictionary.cs index 3ace497bc4..75e2141ea6 100644 --- a/DisCatSharp.Common/Types/CharSpanLookupDictionary.cs +++ b/DisCatSharp.Common/Types/CharSpanLookupDictionary.cs @@ -28,7 +28,7 @@ namespace DisCatSharp.Common; /// -/// Represents collection of string keys and values, allowing the use of for dictionary operations. +/// Represents collection of string keys and values, allowing the use of for dictionary operations. /// /// Type of items in this dictionary. public sealed class CharSpanLookupDictionary : diff --git a/DisCatSharp.Common/Types/CharSpanLookupReadOnlyDictionary.cs b/DisCatSharp.Common/Types/CharSpanLookupReadOnlyDictionary.cs index b8c3b2a1d5..e10dd97ff7 100644 --- a/DisCatSharp.Common/Types/CharSpanLookupReadOnlyDictionary.cs +++ b/DisCatSharp.Common/Types/CharSpanLookupReadOnlyDictionary.cs @@ -29,7 +29,7 @@ namespace DisCatSharp.Common; /// -/// Represents collection of string keys and values, allowing the use of for dictionary operations. +/// Represents collection of string keys and values, allowing the use of for dictionary operations. /// /// Type of items in this dictionary. public sealed class CharSpanLookupReadOnlyDictionary : IReadOnlyDictionary diff --git a/DisCatSharp.Common/Types/ContinuousMemoryBuffer.cs b/DisCatSharp.Common/Types/ContinuousMemoryBuffer.cs index 0368bb08dc..95937b8fb6 100644 --- a/DisCatSharp.Common/Types/ContinuousMemoryBuffer.cs +++ b/DisCatSharp.Common/Types/ContinuousMemoryBuffer.cs @@ -55,7 +55,7 @@ public sealed class ContinuousMemoryBuffer : IMemoryBuffer where T : unman /// Creates a new buffer with a specified segment size, specified number of initially-allocated segments, and supplied memory pool. /// /// Initial size of the buffer in bytes. Defaults to 64KiB. - /// Memory pool to use for renting buffers. Defaults to . + /// Memory pool to use for renting buffers. Defaults to . /// Determines whether the underlying buffers should be cleared on exit. If dealing with sensitive data, it might be a good idea to set this option to true. public ContinuousMemoryBuffer(int initialSize = 65536, MemoryPool memPool = default, bool clearOnDispose = false) { diff --git a/DisCatSharp.Common/Types/MemoryBuffer.cs b/DisCatSharp.Common/Types/MemoryBuffer.cs index bc90b25aab..fd91cdd1f5 100644 --- a/DisCatSharp.Common/Types/MemoryBuffer.cs +++ b/DisCatSharp.Common/Types/MemoryBuffer.cs @@ -59,7 +59,7 @@ public sealed class MemoryBuffer : IMemoryBuffer where T : unmanaged /// /// Byte size of an individual segment. Defaults to 64KiB. /// Number of segments to allocate. Defaults to 0. - /// Memory pool to use for renting buffers. Defaults to . + /// Memory pool to use for renting buffers. Defaults to . /// Determines whether the underlying buffers should be cleared on exit. If dealing with sensitive data, it might be a good idea to set this option to true. public MemoryBuffer(int segmentSize = 65536, int initialSegmentCount = 0, MemoryPool memPool = default, bool clearOnDispose = false) { diff --git a/DisCatSharp.Common/Types/SecureRandom.cs b/DisCatSharp.Common/Types/SecureRandom.cs index 917747b7c7..c7a8002522 100644 --- a/DisCatSharp.Common/Types/SecureRandom.cs +++ b/DisCatSharp.Common/Types/SecureRandom.cs @@ -29,7 +29,7 @@ namespace DisCatSharp.Common; /// -/// Provides a cryptographically-secure pseudorandom number generator (CSPRNG) implementation compatible with . +/// Provides a cryptographically-secure pseudorandom number generator (CSPRNG) implementation compatible with . /// public sealed class SecureRandom : Random, IDisposable { diff --git a/DisCatSharp.Common/Types/Serialization/ComplexDecomposer.cs b/DisCatSharp.Common/Types/Serialization/ComplexDecomposer.cs index dc7f309762..b6c5e5e39e 100644 --- a/DisCatSharp.Common/Types/Serialization/ComplexDecomposer.cs +++ b/DisCatSharp.Common/Types/Serialization/ComplexDecomposer.cs @@ -27,7 +27,7 @@ namespace DisCatSharp.Common.Serialization; /// -/// Decomposes numbers into tuples (arrays of 2). +/// Decomposes numbers into tuples (arrays of 2). /// public sealed class ComplexDecomposer : IDecomposer { diff --git a/DisCatSharp.Common/Utilities/AsyncEvent/AsyncEvent.cs b/DisCatSharp.Common/Utilities/AsyncEvent/AsyncEvent.cs index 55496f2433..d838d23af3 100644 --- a/DisCatSharp.Common/Utilities/AsyncEvent/AsyncEvent.cs +++ b/DisCatSharp.Common/Utilities/AsyncEvent/AsyncEvent.cs @@ -56,7 +56,7 @@ public sealed class AsyncEvent : AsyncEvent where TArgs : AsyncEventArgs { /// - /// Gets the maximum allotted execution time for all handlers. Any event which causes the handler to time out + /// Gets the maximum allotted execution time for all handlers. Any event which causes the handler to time out /// will raise a non-fatal . /// public TimeSpan MaximumExecutionTime { get; } @@ -69,7 +69,7 @@ public sealed class AsyncEvent : AsyncEvent /// Creates a new asynchronous event with specified name and exception handler. /// /// Name of this event. - /// Maximum handler execution time. A value of means infinite. + /// Maximum handler execution time. A value of means infinite. /// Delegate which handles exceptions caused by this event. public AsyncEvent(string name, TimeSpan maxExecutionTime, AsyncEventExceptionHandler exceptionHandler) : base(name) diff --git a/DisCatSharp.Common/Utilities/AsyncManualResetEvent.cs b/DisCatSharp.Common/Utilities/AsyncManualResetEvent.cs index 1dd49f83da..129a9fdb13 100644 --- a/DisCatSharp.Common/Utilities/AsyncManualResetEvent.cs +++ b/DisCatSharp.Common/Utilities/AsyncManualResetEvent.cs @@ -26,7 +26,7 @@ namespace DisCatSharp.Common.Utilities; /// -/// Represents a thread synchronization event that, when signaled, must be reset manually. Unlike , this event is asynchronous. +/// Represents a thread synchronization event that, when signaled, must be reset manually. Unlike , this event is asynchronous. /// public sealed class AsyncManualResetEvent { diff --git a/DisCatSharp.Common/Utilities/Extensions.cs b/DisCatSharp.Common/Utilities/Extensions.cs index 7777aa83f1..ce4dee7a53 100644 --- a/DisCatSharp.Common/Utilities/Extensions.cs +++ b/DisCatSharp.Common/Utilities/Extensions.cs @@ -32,8 +32,8 @@ namespace DisCatSharp.Common; public static class Extensions { /// - /// Deconstructs a key-value pair item () into 2 separate variables. - /// This allows for enumerating over dictionaries in foreach blocks by using a (k, v) tuple as the enumerator variable, instead of having to use a directly. + /// Deconstructs a key-value pair item () into 2 separate variables. + /// This allows for enumerating over dictionaries in foreach blocks by using a (k, v) tuple as the enumerator variable, instead of having to use a directly. /// /// Type of dictionary item key. /// Type of dictionary item value. diff --git a/DisCatSharp.Interactivity/EventHandling/Requests/PaginationRequest.cs b/DisCatSharp.Interactivity/EventHandling/Requests/PaginationRequest.cs index dd28566208..5cc48ff5a8 100644 --- a/DisCatSharp.Interactivity/EventHandling/Requests/PaginationRequest.cs +++ b/DisCatSharp.Interactivity/EventHandling/Requests/PaginationRequest.cs @@ -179,7 +179,7 @@ public async Task PreviousPageAsync() /// /// Gets the buttons async. /// - /// + /// #pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously public async Task> GetButtonsAsync() #pragma warning restore CS1998 // Async method lacks 'await' operators and will run synchronously diff --git a/DisCatSharp.Interactivity/Extensions/ChannelExtensions.cs b/DisCatSharp.Interactivity/Extensions/ChannelExtensions.cs index 2f9e96daa3..5710cd1868 100644 --- a/DisCatSharp.Interactivity/Extensions/ChannelExtensions.cs +++ b/DisCatSharp.Interactivity/Extensions/ChannelExtensions.cs @@ -43,7 +43,7 @@ public static class ChannelExtensions /// The channel to monitor. /// A predicate that should return if a message matches. /// Overrides the timeout set in - /// Thrown if interactivity is not enabled for the client associated with the channel. + /// Thrown if interactivity is not enabled for the client associated with the channel. public static Task> GetNextMessageAsync(this DiscordChannel channel, Func predicate, TimeSpan? timeoutOverride = null) => GetInteractivity(channel).WaitForMessageAsync(msg => msg.ChannelId == channel.Id && predicate(msg), timeoutOverride); @@ -52,7 +52,7 @@ public static Task> GetNextMessageAsync(this /// /// The channel to monitor. /// Overrides the timeout set in - /// Thrown if interactivity is not enabled for the client associated with the channel. + /// Thrown if interactivity is not enabled for the client associated with the channel. public static Task> GetNextMessageAsync(this DiscordChannel channel, TimeSpan? timeoutOverride = null) => channel.GetNextMessageAsync(msg => true, timeoutOverride); @@ -62,7 +62,7 @@ public static Task> GetNextMessageAsync(this /// The channel to monitor. /// The target user. /// Overrides the timeout set in - /// Thrown if interactivity is not enabled for the client associated with the channel. + /// Thrown if interactivity is not enabled for the client associated with the channel. public static Task> GetNextMessageAsync(this DiscordChannel channel, DiscordUser user, TimeSpan? timeoutOverride = null) => channel.GetNextMessageAsync(msg => msg.Author.Id == user.Id, timeoutOverride); @@ -72,7 +72,7 @@ public static Task> GetNextMessageAsync(this /// The target channel. /// The target user. /// Overrides the timeout set in - /// Thrown if interactivity is not enabled for the client associated with the channel. + /// Thrown if interactivity is not enabled for the client associated with the channel. public static Task> WaitForUserTypingAsync(this DiscordChannel channel, DiscordUser user, TimeSpan? timeoutOverride = null) => GetInteractivity(channel).WaitForUserTypingAsync(user, channel, timeoutOverride); @@ -87,7 +87,7 @@ public static Task> WaitForUserTypingA /// Pagination behaviour (when hitting max and min indices). /// Deletion behaviour. /// Override timeout period. - /// Thrown if interactivity is not enabled for the client associated with the channel. + /// Thrown if interactivity is not enabled for the client associated with the channel. public static Task SendPaginatedMessageAsync(this DiscordChannel channel, DiscordUser user, IEnumerable pages, PaginationEmojis emojis, PaginationBehaviour? behaviour = default, PaginationDeletion? deletion = default, TimeSpan? timeoutOverride = null) => GetInteractivity(channel).SendPaginatedMessageAsync(channel, user, pages, emojis, behaviour, deletion, timeoutOverride); @@ -101,7 +101,7 @@ public static Task SendPaginatedMessageAsync(this DiscordChannel channel, Discor /// Pagination behaviour. /// Deletion behaviour /// A custom cancellation token that can be cancelled at any point. - /// Thrown if interactivity is not enabled for the client associated with the channel. + /// Thrown if interactivity is not enabled for the client associated with the channel. public static Task SendPaginatedMessageAsync(this DiscordChannel channel, DiscordUser user, IEnumerable pages, PaginationButtons buttons, PaginationBehaviour? behaviour = default, ButtonPaginationBehavior? deletion = default, CancellationToken token = default) => GetInteractivity(channel).SendPaginatedMessageAsync(channel, user, pages, buttons, behaviour, deletion, token); @@ -119,7 +119,7 @@ public static Task SendPaginatedMessageAsync(this DiscordChannel channel, Discor /// Pagination behaviour. /// Deletion behaviour. /// Override timeout period. - /// Thrown if interactivity is not enabled for the client associated with the channel. + /// Thrown if interactivity is not enabled for the client associated with the channel. public static Task SendPaginatedMessageAsync(this DiscordChannel channel, DiscordUser user, IEnumerable pages, PaginationButtons buttons, TimeSpan? timeoutOverride, PaginationBehaviour? behaviour = default, ButtonPaginationBehavior? deletion = default) => GetInteractivity(channel).SendPaginatedMessageAsync(channel, user, pages, buttons, timeoutOverride, behaviour, deletion); diff --git a/DisCatSharp.Interactivity/Extensions/ClientExtensions.cs b/DisCatSharp.Interactivity/Extensions/ClientExtensions.cs index 036fe37577..80279d85e8 100644 --- a/DisCatSharp.Interactivity/Extensions/ClientExtensions.cs +++ b/DisCatSharp.Interactivity/Extensions/ClientExtensions.cs @@ -39,7 +39,7 @@ public static class ClientExtensions /// The client to enable interactivity for. /// A configuration instance. Default configuration values will be used if none is provided. /// A brand new instance. - /// Thrown if interactivity has already been enabled for the client instance. + /// Thrown if interactivity has already been enabled for the client instance. public static InteractivityExtension UseInteractivity(this DiscordClient client, InteractivityConfiguration configuration = null) { if (client.GetExtension() != null) throw new InvalidOperationException($"Interactivity is already enabled for this {(client.IsShard ? "shard" : "client")}."); diff --git a/DisCatSharp.Interactivity/Extensions/MessageExtensions.cs b/DisCatSharp.Interactivity/Extensions/MessageExtensions.cs index 215cb40a3b..7351706846 100644 --- a/DisCatSharp.Interactivity/Extensions/MessageExtensions.cs +++ b/DisCatSharp.Interactivity/Extensions/MessageExtensions.cs @@ -125,7 +125,7 @@ public static Task> Wai /// /// The message to wait on. /// The predicate to filter interactions by. - /// A token to cancel interactivity with at any time. Pass to wait indefinitely. + /// A token to cancel interactivity with at any time. Pass to wait indefinitely. public static Task> WaitForButtonAsync(this DiscordMessage message, Func predicate, CancellationToken token) => GetInteractivity(message).WaitForButtonAsync(message, predicate, token); @@ -135,7 +135,7 @@ public static Task> Wai /// The message to wait for. /// A filter predicate. /// Override the timeout period specified in . - /// Thrown when the message doesn't contain any dropdowns + /// Thrown when the message doesn't contain any dropdowns public static Task> WaitForSelectAsync(this DiscordMessage message, Func predicate, TimeSpan? timeoutOverride = null) => GetInteractivity(message).WaitForSelectAsync(message, predicate, timeoutOverride); @@ -145,8 +145,8 @@ public static Task> Wai /// /// The message to wait for. /// A filter predicate. - /// A token that can be used to cancel interactivity. Pass to wait indefinitely. - /// Thrown when the message doesn't contain any dropdowns + /// A token that can be used to cancel interactivity. Pass to wait indefinitely. + /// Thrown when the message doesn't contain any dropdowns public static Task> WaitForSelectAsync(this DiscordMessage message, Func predicate, CancellationToken token) => GetInteractivity(message).WaitForSelectAsync(message, predicate, token); @@ -194,7 +194,7 @@ public static Task> Wai /// Target message. /// The target user. /// Overrides the timeout set in - /// Thrown if interactivity is not enabled for the client associated with the message. + /// Thrown if interactivity is not enabled for the client associated with the message. public static Task> WaitForReactionAsync(this DiscordMessage message, DiscordUser user, TimeSpan? timeoutOverride = null) => GetInteractivity(message).WaitForReactionAsync(message, user, timeoutOverride); @@ -205,7 +205,7 @@ public static Task> WaitForReac /// The target user. /// The target emoji. /// Overrides the timeout set in - /// Thrown if interactivity is not enabled for the client associated with the message. + /// Thrown if interactivity is not enabled for the client associated with the message. public static Task> WaitForReactionAsync(this DiscordMessage message, DiscordUser user, DiscordEmoji emoji, TimeSpan? timeoutOverride = null) => GetInteractivity(message).WaitForReactionAsync(e => e.Emoji == emoji, message, user, timeoutOverride); @@ -214,7 +214,7 @@ public static Task> WaitForReac /// /// The message to collect reactions from. /// Overrides the timeout set in - /// Thrown if interactivity is not enabled for the client associated with the message. + /// Thrown if interactivity is not enabled for the client associated with the message. public static Task> CollectReactionsAsync(this DiscordMessage message, TimeSpan? timeoutOverride = null) => GetInteractivity(message).CollectReactionsAsync(message, timeoutOverride); @@ -226,7 +226,7 @@ public static Task> CollectReactionsAsync(this Disc /// Options for this poll. /// Overrides the action set in /// Overrides the timeout set in - /// Thrown if interactivity is not enabled for the client associated with the message. + /// Thrown if interactivity is not enabled for the client associated with the message. public static Task> DoPollAsync(this DiscordMessage message, IEnumerable emojis, PollBehaviour? behaviorOverride = null, TimeSpan? timeoutOverride = null) => GetInteractivity(message).DoPollAsync(message, emojis, behaviorOverride, timeoutOverride); diff --git a/DisCatSharp.Interactivity/InteractivityExtension.cs b/DisCatSharp.Interactivity/InteractivityExtension.cs index 42cfda735b..c0fa81fed5 100644 --- a/DisCatSharp.Interactivity/InteractivityExtension.cs +++ b/DisCatSharp.Interactivity/InteractivityExtension.cs @@ -135,8 +135,8 @@ public async Task> DoPollAsync(DiscordMessage m, I /// A collection of buttons to listen for. /// Override the timeout period in . /// A with the result of button that was pressed, if any. - /// Thrown when attempting to wait for a message that is not authored by the current user. - /// Thrown when the message does not contain a button with the specified Id, or any buttons at all. + /// Thrown when attempting to wait for a message that is not authored by the current user. + /// Thrown when the message does not contain a button with the specified Id, or any buttons at all. public Task> WaitForButtonAsync(DiscordMessage message, IEnumerable buttons, TimeSpan? timeoutOverride = null) => this.WaitForButtonAsync(message, buttons, this.GetCancellationToken(timeoutOverride)); @@ -147,8 +147,8 @@ public Task> WaitForBut /// A collection of buttons to listen for. /// A custom cancellation token that can be cancelled at any point. /// A with the result of button that was pressed, if any. - /// Thrown when attempting to wait for a message that is not authored by the current user. - /// Thrown when the message does not contain a button with the specified Id, or any buttons at all. + /// Thrown when attempting to wait for a message that is not authored by the current user. + /// Thrown when the message does not contain a button with the specified Id, or any buttons at all. public async Task> WaitForButtonAsync(DiscordMessage message, IEnumerable buttons, CancellationToken token) { if (message.Author != this.Client.CurrentUser) @@ -204,8 +204,8 @@ await this /// The message to wait for the button on. /// Override the timeout period specified in . /// A with the result of button that was pressed, if any. - /// Thrown when attempting to wait for a message that is not authored by the current user. - /// Thrown when the message does not contain a button with the specified Id, or any buttons at all. + /// Thrown when attempting to wait for a message that is not authored by the current user. + /// Thrown when the message does not contain a button with the specified Id, or any buttons at all. public Task> WaitForButtonAsync(DiscordMessage message, TimeSpan? timeoutOverride = null) => this.WaitForButtonAsync(message, this.GetCancellationToken(timeoutOverride)); @@ -215,8 +215,8 @@ public Task> WaitForBut /// The message to wait for the button on. /// A custom cancellation token that can be cancelled at any point. /// A with the result of button that was pressed, if any. - /// Thrown when attempting to wait for a message that is not authored by the current user. - /// Thrown when the message does not contain a button with the specified Id, or any buttons at all. + /// Thrown when attempting to wait for a message that is not authored by the current user. + /// Thrown when the message does not contain a button with the specified Id, or any buttons at all. public async Task> WaitForButtonAsync(DiscordMessage message, CancellationToken token) { if (message.Author != this.Client.CurrentUser) @@ -246,8 +246,8 @@ await this /// The user to wait for the button press from. /// Override the timeout period specified in . /// A with the result of button that was pressed, if any. - /// Thrown when attempting to wait for a message that is not authored by the current user. - /// Thrown when the message does not contain a button with the specified Id, or any buttons at all. + /// Thrown when attempting to wait for a message that is not authored by the current user. + /// Thrown when the message does not contain a button with the specified Id, or any buttons at all. public Task> WaitForButtonAsync(DiscordMessage message, DiscordUser user, TimeSpan? timeoutOverride = null) => this.WaitForButtonAsync(message, user, this.GetCancellationToken(timeoutOverride)); @@ -258,8 +258,8 @@ public Task> WaitForBut /// The user to wait for the button press from. /// A custom cancellation token that can be cancelled at any point. /// A with the result of button that was pressed, if any. - /// Thrown when attempting to wait for a message that is not authored by the current user. - /// Thrown when the message does not contain a button with the specified Id, or any buttons at all. + /// Thrown when attempting to wait for a message that is not authored by the current user. + /// Thrown when the message does not contain a button with the specified Id, or any buttons at all. public async Task> WaitForButtonAsync(DiscordMessage message, DiscordUser user, CancellationToken token) { if (message.Author != this.Client.CurrentUser) @@ -287,8 +287,8 @@ public async Task> Wait /// The Id of the button to wait for. /// Override the timeout period specified in . /// A with the result of the operation. - /// Thrown when attempting to wait for a message that is not authored by the current user. - /// Thrown when the message does not contain a button with the specified Id, or any buttons at all. + /// Thrown when attempting to wait for a message that is not authored by the current user. + /// Thrown when the message does not contain a button with the specified Id, or any buttons at all. public Task> WaitForButtonAsync(DiscordMessage message, string id, TimeSpan? timeoutOverride = null) => this.WaitForButtonAsync(message, id, this.GetCancellationToken(timeoutOverride)); @@ -299,8 +299,8 @@ public Task> WaitForBut /// The Id of the button to wait for. /// Override the timeout period specified in . /// A with the result of the operation. - /// Thrown when attempting to wait for a message that is not authored by the current user. - /// Thrown when the message does not contain a button with the specified Id, or any buttons at all. + /// Thrown when attempting to wait for a message that is not authored by the current user. + /// Thrown when the message does not contain a button with the specified Id, or any buttons at all. public async Task> WaitForButtonAsync(DiscordMessage message, string id, CancellationToken token) { if (message.Author != this.Client.CurrentUser) @@ -336,7 +336,7 @@ public Task> WaitForBut /// /// The message to wait on. /// The predicate to filter interactions by. - /// A token to cancel interactivity with at any time. Pass to wait indefinitely. + /// A token to cancel interactivity with at any time. Pass to wait indefinitely. public async Task> WaitForButtonAsync(DiscordMessage message, Func predicate, CancellationToken token) { if (message.Author != this.Client.CurrentUser) @@ -363,7 +363,7 @@ public async Task> Wait /// The message to wait for. /// A filter predicate. /// Override the timeout period specified in . - /// Thrown when the Provided message does not contain any dropdowns + /// Thrown when the Provided message does not contain any dropdowns public Task> WaitForSelectAsync(DiscordMessage message, Func predicate, TimeSpan? timeoutOverride = null) => this.WaitForSelectAsync(message, predicate, this.GetCancellationToken(timeoutOverride)); @@ -372,8 +372,8 @@ public Task> WaitForSel /// /// The message to wait for. /// A filter predicate. - /// A token that can be used to cancel interactivity. Pass to wait indefinitely. - /// Thrown when the Provided message does not contain any dropdowns + /// A token that can be used to cancel interactivity. Pass to wait indefinitely. + /// Thrown when the Provided message does not contain any dropdowns public async Task> WaitForSelectAsync(DiscordMessage message, Func predicate, CancellationToken token) { if (message.Author != this.Client.CurrentUser) @@ -400,7 +400,7 @@ public async Task> Wait /// The message to wait on. /// The Id of the dropdown to wait on. /// Override the timeout period specified in . - /// Thrown when the message does not have any dropdowns or any dropdown with the specified Id. + /// Thrown when the message does not have any dropdowns or any dropdown with the specified Id. public Task> WaitForSelectAsync(DiscordMessage message, string id, TimeSpan? timeoutOverride = null) => this.WaitForSelectAsync(message, id, this.GetCancellationToken(timeoutOverride)); @@ -410,7 +410,7 @@ public Task> WaitForSel /// The message to wait on. /// The Id of the dropdown to wait on. /// A custom cancellation token that can be cancelled at any point. - /// Thrown when the message does not have any dropdowns or any dropdown with the specified Id. + /// Thrown when the message does not have any dropdowns or any dropdown with the specified Id. public async Task> WaitForSelectAsync(DiscordMessage message, string id, CancellationToken token) { if (message.Author != this.Client.CurrentUser) @@ -440,7 +440,7 @@ public async Task> Wait /// The user to wait on. /// The Id of the dropdown to wait on. /// Override the timeout period specified in . - /// Thrown when the message does not have any dropdowns or any dropdown with the specified Id. + /// Thrown when the message does not have any dropdowns or any dropdown with the specified Id. public Task> WaitForSelectAsync(DiscordMessage message, DiscordUser user, string id, TimeSpan? timeoutOverride = null) => this.WaitForSelectAsync(message, user, id, this.GetCancellationToken(timeoutOverride)); @@ -451,7 +451,7 @@ public Task> WaitForSel /// The user to wait on. /// The Id of the dropdown to wait on. /// A custom cancellation token that can be cancelled at any point. - /// Thrown when the message does not have any dropdowns or any dropdown with the specified Id. + /// Thrown when the message does not have any dropdowns or any dropdown with the specified Id. public async Task> WaitForSelectAsync(DiscordMessage message, DiscordUser user, string id, CancellationToken token) { if (message.Author != this.Client.CurrentUser) diff --git a/DisCatSharp.Lavalink/LavalinkExtension.cs b/DisCatSharp.Lavalink/LavalinkExtension.cs index 9aa3231dd0..7f21597542 100644 --- a/DisCatSharp.Lavalink/LavalinkExtension.cs +++ b/DisCatSharp.Lavalink/LavalinkExtension.cs @@ -66,7 +66,7 @@ internal LavalinkExtension() /// DO NOT USE THIS MANUALLY. /// /// DO NOT USE THIS MANUALLY. - /// + /// protected internal override void Setup(DiscordClient client) { if (this.Client != null) diff --git a/DisCatSharp.VoiceNext/StreamExtensions.cs b/DisCatSharp.VoiceNext/StreamExtensions.cs index 7f7357bc2b..7c0c62b111 100644 --- a/DisCatSharp.VoiceNext/StreamExtensions.cs +++ b/DisCatSharp.VoiceNext/StreamExtensions.cs @@ -36,7 +36,7 @@ public static class StreamExtensions /// /// Asynchronously reads the bytes from the current stream and writes them to the specified . /// - /// The source + /// The source /// The target /// The size, in bytes, of the buffer. This value must be greater than zero. If , defaults to the packet size specified by . /// The token to monitor for cancellation requests. diff --git a/DisCatSharp.VoiceNext/VoiceNextExtension.cs b/DisCatSharp.VoiceNext/VoiceNextExtension.cs index fc7f47b3f8..3ab3182459 100644 --- a/DisCatSharp.VoiceNext/VoiceNextExtension.cs +++ b/DisCatSharp.VoiceNext/VoiceNextExtension.cs @@ -82,7 +82,7 @@ internal VoiceNextExtension(VoiceNextConfiguration config) /// DO NOT USE THIS MANUALLY. /// /// DO NOT USE THIS MANUALLY. - /// + /// protected internal override void Setup(DiscordClient client) { if (this.Client != null) diff --git a/DisCatSharp/Clients/BaseDiscordClient.cs b/DisCatSharp/Clients/BaseDiscordClient.cs index d223c1b6e8..77a35bc46c 100644 --- a/DisCatSharp/Clients/BaseDiscordClient.cs +++ b/DisCatSharp/Clients/BaseDiscordClient.cs @@ -83,7 +83,7 @@ public DisCatSharpTeam LibraryDeveloperTeamAsync public DiscordApplication CurrentApplication { get; internal set; } /// - /// Exposes a Http Client for custom operations. + /// Exposes a Http Client for custom operations. /// public HttpClient RestClient { get; internal set; } @@ -230,7 +230,7 @@ public async Task GetCurrentApplicationAsync() /// /// Gets a list of voice regions. /// - /// Thrown when Discord is unable to process the request. + /// Thrown when Discord is unable to process the request. public Task> ListVoiceRegionsAsync() => this.ApiClient.ListVoiceRegionsAsync(); diff --git a/DisCatSharp/Clients/DiscordClient.cs b/DisCatSharp/Clients/DiscordClient.cs index c6ab4654dd..739119e5bb 100644 --- a/DisCatSharp/Clients/DiscordClient.cs +++ b/DisCatSharp/Clients/DiscordClient.cs @@ -286,9 +286,9 @@ public T GetExtension() where T : BaseExtension /// The activity to set. Defaults to null. /// The optional status to set. Defaults to null. /// Since when is the client performing the specified activity. Defaults to null. - /// Thrown when an invalid token was provided. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when an invalid token was provided. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public async Task ConnectAsync(DiscordActivity activity = null, UserStatus? status = null, DateTimeOffset? idlesince = null) { // Check if connection lock is already set, and set it if it isn't @@ -400,8 +400,8 @@ public async Task DisconnectAsync() /// Id of the user /// Whether to fetch the user again. Defaults to true. /// The requested user. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public async Task GetUserAsync(ulong userId, bool fetch = true) { if (!fetch) @@ -437,14 +437,14 @@ public async Task RemoveGlobalApplicationCommandsAsync() /// /// Removes all global application commands for a specific guild id. /// - /// The target guild id. + /// The target guild id. public async Task RemoveGuildApplicationCommandsAsync(ulong guildId) => await this.ApiClient.BulkOverwriteGuildApplicationCommandsAsync(this.CurrentApplication.Id, guildId, Array.Empty()); /// /// Removes all global application commands for a specific guild. /// - /// The target guild. + /// The target guild. public async Task RemoveGuildApplicationCommandsAsync(DiscordGuild guild) => await this.RemoveGuildApplicationCommandsAsync(guild.Id); @@ -453,9 +453,9 @@ public async Task RemoveGuildApplicationCommandsAsync(DiscordGuild guild) /// /// The id of the channel to get. /// The requested channel. - /// Thrown when the channel does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the channel does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public async Task GetChannelAsync(ulong id) => this.InternalGetCachedChannel(id) ?? await this.ApiClient.GetChannelAsync(id).ConfigureAwait(false); @@ -464,9 +464,9 @@ public async Task GetChannelAsync(ulong id) /// /// The id of the thread to get. /// The requested thread. - /// Thrown when the thread does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the thread does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public async Task GetThreadAsync(ulong id) => this.InternalGetCachedThread(id) ?? await this.ApiClient.GetThreadAsync(id).ConfigureAwait(false); @@ -476,10 +476,10 @@ public async Task GetThreadAsync(ulong id) /// The channel to send to. /// The message content to send. /// The message that was sent. - /// Thrown when the client does not have the permission. - /// Thrown when the channel does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the channel does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task SendMessageAsync(DiscordChannel channel, string content) => this.ApiClient.CreateMessageAsync(channel.Id, content, embeds: null, sticker: null, replyMessageId: null, mentionReply: false, failOnInvalidReply: false); @@ -489,10 +489,10 @@ public Task SendMessageAsync(DiscordChannel channel, string cont /// The channel to send to. /// The embed to attach to the message. /// The message that was sent. - /// Thrown when the client does not have the permission. - /// Thrown when the channel does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the channel does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task SendMessageAsync(DiscordChannel channel, DiscordEmbed embed) => this.ApiClient.CreateMessageAsync(channel.Id, null, embed != null ? new[] { embed } : null, sticker: null, replyMessageId: null, mentionReply: false, failOnInvalidReply: false); @@ -503,10 +503,10 @@ public Task SendMessageAsync(DiscordChannel channel, DiscordEmbe /// The message content to send. /// The embed to attach to the message. /// The message that was sent. - /// Thrown when the client does not have the permission. - /// Thrown when the channel does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the channel does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task SendMessageAsync(DiscordChannel channel, string content, DiscordEmbed embed) => this.ApiClient.CreateMessageAsync(channel.Id, content, embed != null ? new[] { embed } : null, sticker: null, replyMessageId: null, mentionReply: false, failOnInvalidReply: false); @@ -516,23 +516,23 @@ public Task SendMessageAsync(DiscordChannel channel, string cont /// The channel to send the message to. /// The message builder. /// The message that was sent. - /// Thrown when the client does not have the permission if TTS is false and if TTS is true. - /// Thrown when the channel does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission if TTS is false and if TTS is true. + /// Thrown when the channel does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task SendMessageAsync(DiscordChannel channel, DiscordMessageBuilder builder) => this.ApiClient.CreateMessageAsync(channel.Id, builder); /// - /// Sends a message with an . + /// Sends a message with an . /// /// The channel to send the message to. /// The message builder. /// The message that was sent. - /// Thrown when the client does not have the permission if TTS is false and if TTS is true. - /// Thrown when the channel does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission if TTS is false and if TTS is true. + /// Thrown when the channel does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task SendMessageAsync(DiscordChannel channel, Action action) { var builder = new DiscordMessageBuilder(); @@ -551,9 +551,9 @@ public Task SendMessageAsync(DiscordChannel channel, ActionDefault message notification settings for the guild. /// System channel flags for the guild. /// The created guild. - /// Thrown when the channel does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the channel does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task CreateGuildAsync(string name, string region = null, Optional icon = default, VerificationLevel? verificationLevel = null, DefaultMessageNotifications? defaultMessageNotifications = null, SystemChannelFlags? systemChannelFlags = null) { @@ -568,8 +568,8 @@ public Task CreateGuildAsync(string name, string region = null, Op /// Name of the guild. /// Stream containing the icon for the guild. /// The created guild. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task CreateGuildFromTemplateAsync(string code, string name, Optional icon = default) { var iconb64 = ImageTool.Base64FromStream(icon); @@ -591,9 +591,9 @@ public Task CreateGuildFromTemplateAsync(string code, string name, /// The json body. /// The additional headers. /// The ratelimit wait override. - /// Thrown when the resource does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the resource does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. /// A awaitable RestResponse [Obsolete("This is no longer needed. Use DiscordClient.RestClient instead.", false)] public async Task ExecuteRawRequestAsync(RestRequestMethod method, string route, object routeParams, string jsonBody = null, Dictionary additionalHeaders = null, double? ratelimitWaitOverride = null) @@ -613,9 +613,9 @@ public async Task ExecuteRawRequestAsync(RestRequestMethod method, /// The guild ID to search for. /// Whether to include approximate presence and member counts in the returned guild. /// The requested Guild. - /// Thrown when the guild does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the guild does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public async Task GetGuildAsync(ulong id, bool? withCounts = null) { if (this.GuildsInternal.TryGetValue(id, out var guild) && (!withCounts.HasValue || !withCounts.Value)) @@ -633,9 +633,9 @@ public async Task GetGuildAsync(ulong id, bool? withCounts = null) /// /// The guild ID. /// - /// Thrown when the guild does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the guild does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task GetGuildPreviewAsync(ulong id) => this.ApiClient.GetGuildPreviewAsync(id); @@ -647,17 +647,17 @@ public Task GetGuildPreviewAsync(ulong id) /// Whether to include the expiration date in the returned invite. /// The scheduled event id. /// The requested Invite. - /// Thrown when the invite does not exists. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the invite does not exists. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task GetInviteByCodeAsync(string code, bool? withCounts = null, bool? withExpiration = null, ulong? scheduledEventId = null) => this.ApiClient.GetInviteAsync(code, withCounts, withExpiration, scheduledEventId); /// /// Gets a list of user connections. /// - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task> GetConnectionsAsync() => this.ApiClient.GetUserConnectionsAsync(); @@ -666,9 +666,9 @@ public Task> GetConnectionsAsync() /// /// The requested sticker. /// The id of the sticker. - /// Thrown when the sticker does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the sticker does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task GetStickerAsync(ulong id) => this.ApiClient.GetStickerAsync(id); @@ -677,8 +677,8 @@ public Task GetStickerAsync(ulong id) /// Gets all nitro sticker packs. /// /// List of sticker packs. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task> GetStickerPacksAsync() => this.ApiClient.GetStickerPacksAsync(); @@ -708,9 +708,9 @@ public Uri GetInAppOAuth(Permissions permissions = Permissions.None, OAuthScopes /// /// The target webhook id. /// The requested webhook. - /// Thrown when the webhook does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the webhook does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task GetWebhookAsync(ulong id) => this.ApiClient.GetWebhookAsync(id); @@ -720,9 +720,9 @@ public Task GetWebhookAsync(ulong id) /// The target webhook id. /// The target webhook token. /// The requested webhook. - /// Thrown when the webhook does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the webhook does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task GetWebhookWithTokenAsync(ulong id, string token) => this.ApiClient.GetWebhookWithTokenAsync(id, token); @@ -742,9 +742,9 @@ public Task UpdateStatusAsync(DiscordActivity activity = null, UserStatus? userS /// New username. /// New avatar. /// The modified user. - /// Thrown when the user does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the user does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public async Task UpdateCurrentUserAsync(string username = null, Optional avatar = default) { var av64 = ImageTool.Base64FromStream(avatar); @@ -762,8 +762,8 @@ public async Task UpdateCurrentUserAsync(string username = null, Op /// /// The code of the template. /// The guild template for the code. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task GetTemplateAsync(string code) => this.ApiClient.GetTemplateAsync(code); diff --git a/DisCatSharp/Clients/DiscordShardedClient.cs b/DisCatSharp/Clients/DiscordShardedClient.cs index c45a220824..5fd5084e78 100644 --- a/DisCatSharp/Clients/DiscordShardedClient.cs +++ b/DisCatSharp/Clients/DiscordShardedClient.cs @@ -152,8 +152,8 @@ public DiscordShardedClient(DiscordConfiguration config) /// /// Initializes and connects all shards. /// - /// - /// + /// + /// public async Task StartAsync() { if (this._isStarted) @@ -206,7 +206,7 @@ public async Task StartAsync() /// /// Disconnects and disposes all shards. /// - /// + /// public Task StopAsync() => this.InternalStopAsync(); diff --git a/DisCatSharp/DiscordConfiguration.cs b/DisCatSharp/DiscordConfiguration.cs index 9f28db6f00..58c670f55e 100644 --- a/DisCatSharp/DiscordConfiguration.cs +++ b/DisCatSharp/DiscordConfiguration.cs @@ -61,7 +61,7 @@ public string Token /// /// Sets the minimum logging level for messages. - /// Typically, the default value of is ok for most uses. + /// Typically, the default value of is ok for most uses. /// public LogLevel MinimumLogLevel { internal get; set; } = LogLevel.Information; @@ -161,8 +161,8 @@ public string Token /// /// Sets the factory method used to create instances of WebSocket clients. - /// Use and equivalents on other implementations to switch out client implementations. - /// Defaults to . + /// Use and equivalents on other implementations to switch out client implementations. + /// Defaults to . /// public WebSocketClientFactoryDelegate WebSocketClientFactory { diff --git a/DisCatSharp/Entities/Channel/DiscordChannel.cs b/DisCatSharp/Entities/Channel/DiscordChannel.cs index b01b117432..aea3d05d56 100644 --- a/DisCatSharp/Entities/Channel/DiscordChannel.cs +++ b/DisCatSharp/Entities/Channel/DiscordChannel.cs @@ -315,10 +315,10 @@ internal DiscordChannel() /// /// Content of the message to send. /// The sent message. - /// Thrown when the client does not have the permission if TTS is true and if TTS is true. - /// Thrown when the channel does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission if TTS is true and if TTS is true. + /// Thrown when the channel does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task SendMessageAsync(string content) => !this.IsWritable() ? throw new ArgumentException("Cannot send a text message to a non-text channel.") @@ -329,10 +329,10 @@ public Task SendMessageAsync(string content) => /// /// Embed to attach to the message. /// The sent message. - /// Thrown when the client does not have the permission and if TTS is true. - /// Thrown when the channel does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission and if TTS is true. + /// Thrown when the channel does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task SendMessageAsync(DiscordEmbed embed) => !this.IsWritable() ? throw new ArgumentException("Cannot send a text message to a non-text channel.") @@ -344,10 +344,10 @@ public Task SendMessageAsync(DiscordEmbed embed) => /// Embed to attach to the message. /// Content of the message to send. /// The sent message. - /// Thrown when the client does not have the permission if TTS is true and if TTS is true. - /// Thrown when the channel does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission if TTS is true and if TTS is true. + /// Thrown when the channel does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task SendMessageAsync(string content, DiscordEmbed embed) => !this.IsWritable() ? throw new ArgumentException("Cannot send a text message to a non-text channel.") @@ -358,10 +358,10 @@ public Task SendMessageAsync(string content, DiscordEmbed embed) /// /// The builder with all the items to send. /// The sent message. - /// Thrown when the client does not have the permission TTS is true and if TTS is true. - /// Thrown when the channel does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission TTS is true and if TTS is true. + /// Thrown when the channel does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task SendMessageAsync(DiscordMessageBuilder builder) => this.Discord.ApiClient.CreateMessageAsync(this.Id, builder); @@ -370,10 +370,10 @@ public Task SendMessageAsync(DiscordMessageBuilder builder) /// /// The builder with all the items to send. /// The sent message. - /// Thrown when the client does not have the permission TTS is true and if TTS is true. - /// Thrown when the channel does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission TTS is true and if TTS is true. + /// Thrown when the channel does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task SendMessageAsync(Action action) { var builder = new DiscordMessageBuilder(); @@ -389,10 +389,10 @@ public Task SendMessageAsync(Action actio /// Deletes a guild channel /// /// Reason for audit logs. - /// Thrown when the client does not have the permission. - /// Thrown when the channel does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the channel does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task DeleteAsync(string reason = null) => this.Discord.ApiClient.DeleteChannelAsync(this.Id, reason); @@ -401,10 +401,10 @@ public Task DeleteAsync(string reason = null) /// /// Reason for audit logs. /// Newly-created channel. - /// Thrown when the client does not have the permission. - /// Thrown when the channel does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the channel does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public async Task CloneAsync(string reason = null) { if (this.Guild == null) @@ -443,10 +443,10 @@ public async Task CloneAsync(string reason = null) /// /// The id of the message /// Whether to bypass the message cache - /// Thrown when the client does not have the permission. - /// Thrown when the channel does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the channel does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public async Task GetMessageAsync(ulong id, bool bypassCache = false) => this.Discord.Configuration.MessageCacheSize > 0 && !bypassCache @@ -460,11 +460,11 @@ public async Task GetMessageAsync(ulong id, bool bypassCache = f /// Modifies the current channel. /// /// Action to perform on this channel - /// Thrown when the client does not have the . - /// Thrown when the client does not have the correct for modifying the . - /// Thrown when the channel does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the . + /// Thrown when the client does not have the correct for modifying the . + /// Thrown when the channel does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task ModifyAsync(Action action) { if (this.Type == ChannelType.Forum) @@ -486,11 +486,11 @@ public Task ModifyAsync(Action action) /// Modifies the current forum channel. /// /// Action to perform on this channel - /// Thrown when the client does not have the . - /// Thrown when the client does not have the correct for modifying the . - /// Thrown when the channel does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the . + /// Thrown when the client does not have the correct for modifying the . + /// Thrown when the channel does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task ModifyForumAsync(Action action) { if (this.Type != ChannelType.Forum) @@ -518,10 +518,10 @@ public Task ModifyForumAsync(Action action) /// /// Position the channel should be moved to. /// Reason for audit logs. - /// Thrown when the client does not have the permission. - /// Thrown when the channel does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the channel does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task ModifyPositionAsync(int position, string reason = null) { if (this.Guild == null) @@ -550,12 +550,12 @@ public Task ModifyPositionAsync(int position, string reason = null) /// /// The position. /// The reason. - /// Thrown when the client does not have the permission. - /// Thrown when the channel does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. - /// Thrown when is out of range. - /// Thrown when function is called on a channel without a parent channel. + /// Thrown when the client does not have the permission. + /// Thrown when the channel does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. + /// Thrown when is out of range. + /// Thrown when function is called on a channel without a parent channel. public async Task ModifyPositionInCategoryAsync(int position, string reason = null) { if (!this.IsMovableInParent()) @@ -651,12 +651,12 @@ public async Task RefreshPositionsAsync() /// The mode. Valid: '+' or 'down' to move a channel down | '-' or 'up' to move a channel up /// The position. /// The reason. - /// Thrown when the client does not have the permission. - /// Thrown when the channel does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. - /// Thrown when is out of range. - /// Thrown when function is called on a channel without a parent channel, a wrong mode is given or given position is zero. + /// Thrown when the client does not have the permission. + /// Thrown when the channel does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. + /// Thrown when is out of range. + /// Thrown when function is called on a channel without a parent channel, a wrong mode is given or given position is zero. public Task ModifyPositionInCategorySmartAsync(string mode, int position, string reason = null) { if (!this.IsMovableInParent()) @@ -684,10 +684,10 @@ public Task ModifyPositionInCategorySmartAsync(string mode, int position, string /// New parent for channel. Use to remove from parent. /// Sync permissions with parent. Defaults to null. /// Reason for audit logs. - /// Thrown when the client does not have the permission. - /// Thrown when the channel does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the channel does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task ModifyParentAsync(DiscordChannel newParent, bool? lockPermissions = null, string reason = null) { if (this.Guild == null) @@ -727,10 +727,10 @@ public Task ModifyParentAsync(DiscordChannel newParent, bool? lockPermissions = /// Moves the channel out of a category. /// /// Reason for audit logs. - /// Thrown when the client does not have the permission. - /// Thrown when the channel does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the channel does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task RemoveParentAsync(string reason = null) { if (this.Guild == null) @@ -764,10 +764,10 @@ public Task RemoveParentAsync(string reason = null) /// The amount of messages to fetch. /// Message to fetch before from. /// - /// Thrown when the client does not have the permission. - /// Thrown when the channel does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the channel does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task> GetMessagesBeforeAsync(ulong before, int limit = 100) => this.GetMessagesInternalAsync(limit, before, null, null); @@ -776,10 +776,10 @@ public Task> GetMessagesBeforeAsync(ulong before, /// The amount of messages to fetch. /// Message to fetch after from. /// - /// Thrown when the client does not have the permission. - /// Thrown when the channel does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the channel does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task> GetMessagesAfterAsync(ulong after, int limit = 100) => this.GetMessagesInternalAsync(limit, null, after, null); @@ -788,10 +788,10 @@ public Task> GetMessagesAfterAsync(ulong after, in /// The amount of messages to fetch. /// Message to fetch around from. /// - /// Thrown when the client does not have the permission. - /// Thrown when the channel does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the channel does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task> GetMessagesAroundAsync(ulong around, int limit = 100) => this.GetMessagesInternalAsync(limit, null, null, around); @@ -799,10 +799,10 @@ public Task> GetMessagesAroundAsync(ulong around, /// Returns a list of messages from the last message in the channel. /// The amount of messages to fetch. /// - /// Thrown when the client does not have the permission. - /// Thrown when the channel does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the channel does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task> GetMessagesAsync(int limit = 100) => this.GetMessagesInternalAsync(limit, null, null, null); @@ -859,14 +859,14 @@ private async Task> GetMessagesInternalAsync(int l } /// - /// Deletes multiple messages if they are less than 14 days old. If they are older, none of the messages will be deleted and you will receive a error. + /// Deletes multiple messages if they are less than 14 days old. If they are older, none of the messages will be deleted and you will receive a error. /// /// A collection of messages to delete. /// Reason for audit logs. - /// Thrown when the client does not have the permission. - /// Thrown when the channel does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the channel does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public async Task DeleteMessagesAsync(IEnumerable messages, string reason = null) { // don't enumerate more than once @@ -889,20 +889,20 @@ public async Task DeleteMessagesAsync(IEnumerable messages, stri /// /// The message to be deleted. /// Reason for audit logs. - /// Thrown when the client does not have the permission. - /// Thrown when the channel does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the channel does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task DeleteMessageAsync(DiscordMessage message, string reason = null) => this.Discord.ApiClient.DeleteMessageAsync(this.Id, message.Id, reason); /// /// Returns a list of invite objects /// - /// Thrown when the client does not have the permission. - /// Thrown when the channel does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the channel does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task> GetInvitesAsync() => this.Guild == null ? throw new ArgumentException("Cannot get the invites of a channel that does not belong to a guild.") @@ -919,10 +919,10 @@ public Task> GetInvitesAsync() => /// The target activity. Defaults to null. /// The target user id. Defaults to null. /// The audit log reason. - /// Thrown when the client does not have the permission. - /// Thrown when the channel does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the channel does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task CreateInviteAsync(int maxAge = 86400, int maxUses = 0, bool temporary = false, bool unique = false, TargetType? targetType = null, TargetActivity? targetApplication = null, ulong? targetUser = null, string reason = null) => this.Discord.ApiClient.CreateChannelInviteAsync(this.Id, maxAge, maxUses, targetType, targetApplication, targetUser, temporary, unique, reason); @@ -936,10 +936,10 @@ public Task CreateInviteAsync(int maxAge = 86400, int maxUses = 0 /// Privacy level of the stage (Defaults to . /// Audit log reason. /// Stage instance - /// Thrown when the client does not have the permission. - /// Thrown when the channel does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the channel does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public async Task OpenStageAsync(string topic, bool sendStartNotification = false, StagePrivacyLevel privacyLevel = StagePrivacyLevel.GuildOnly, string reason = null) => await this.Discord.ApiClient.CreateStageInstanceAsync(this.Id, topic, sendStartNotification, privacyLevel, reason); @@ -949,10 +949,10 @@ public async Task OpenStageAsync(string topic, bool sendSt /// New topic of the stage. /// New privacy level of the stage. /// Audit log reason. - /// Thrown when the client does not have the permission. - /// Thrown when the channel does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the channel does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public async Task ModifyStageAsync(Optional topic, Optional privacyLevel, string reason = null) => await this.Discord.ApiClient.ModifyStageInstanceAsync(this.Id, topic, privacyLevel, reason); @@ -960,10 +960,10 @@ public async Task ModifyStageAsync(Optional topic, Optional /// Audit log reason. - /// Thrown when the client does not have the permission. - /// Thrown when the channel does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the channel does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public async Task CloseStageAsync(string reason = null) => await this.Discord.ApiClient.DeleteStageInstanceAsync(this.Id, reason); @@ -971,10 +971,10 @@ public async Task CloseStageAsync(string reason = null) /// Gets a stage. /// /// The requested stage. - /// Thrown when the client does not have the or permission. - /// Thrown when the channel does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the or permission. + /// Thrown when the channel does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public async Task GetStageAsync() => await this.Discord.ApiClient.GetStageInstanceAsync(this.Id); @@ -991,9 +991,9 @@ public async Task GetStageAsync() /// The cover image. /// The reason. /// A scheduled event. - /// Thrown when the resource does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the resource does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public async Task CreateScheduledEventAsync(string name, DateTimeOffset scheduledStartTime, string description = null, Optional coverImage = default, string reason = null) { if (!this.IsVoiceJoinable()) @@ -1019,11 +1019,11 @@ public async Task CreateScheduledEventAsync(string name, /// The per user ratelimit, aka slowdown. /// Audit log reason. /// The created thread. - /// Thrown when the client does not have the or or if creating a private thread the permission. - /// Thrown when the guild hasn't enabled threads atm. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. - /// Thrown when the cannot be modified. This happens, when the guild hasn't reached a certain boost . Or if is not enabled for guild. This happens, if the guild does not have + /// Thrown when the client does not have the or or if creating a private thread the permission. + /// Thrown when the guild hasn't enabled threads atm. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. + /// Thrown when the cannot be modified. This happens, when the guild hasn't reached a certain boost . Or if is not enabled for guild. This happens, if the guild does not have public async Task CreateThreadAsync(string name, ThreadAutoArchiveDuration autoArchiveDuration = ThreadAutoArchiveDuration.OneHour, ChannelType type = ChannelType.PublicThread, int? rateLimitPerUser = null, string reason = null) => type != ChannelType.NewsThread && type != ChannelType.PublicThread && type != ChannelType.PrivateThread ? throw new NotSupportedException("Wrong thread type given.") @@ -1048,10 +1048,10 @@ public async Task CreateThreadAsync(string name, ThreadAut /// The tags to add on creation. /// Audit log reason. /// The created thread. - /// Thrown when the client does not have the permission. - /// Thrown when the guild hasn't enabled threads atm. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the guild hasn't enabled threads atm. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public async Task CreatePostAsync(string name, DiscordMessageBuilder builder, int? rateLimitPerUser = null, IEnumerable? tags = null, string reason = null) { if (this.Type != ChannelType.Forum) @@ -1066,10 +1066,10 @@ public async Task CreatePostAsync(string name, DiscordMess /// /// Get threads created before this thread id. /// Defines the limit of returned . - /// Thrown when the client does not have the permission. - /// Thrown when the channel does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the channel does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public async Task GetJoinedPrivateArchivedThreadsAsync(ulong? before, int? limit) => await this.Discord.ApiClient.GetJoinedPrivateArchivedThreadsAsync(this.Id, before, limit); @@ -1079,10 +1079,10 @@ public async Task GetJoinedPrivateArchivedThreadsAsync(ulon /// /// Get threads created before this thread id. /// Defines the limit of returned . - /// Thrown when the client does not have the permission. - /// Thrown when the channel does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the channel does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public async Task GetPublicArchivedThreadsAsync(ulong? before, int? limit) => await this.Discord.ApiClient.GetPublicArchivedThreadsAsync(this.Id, before, limit); @@ -1092,10 +1092,10 @@ public async Task GetPublicArchivedThreadsAsync(ulong? befo /// /// Get threads created before this thread id. /// Defines the limit of returned . - /// Thrown when the client does not have the or permission. - /// Thrown when the channel does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the or permission. + /// Thrown when the channel does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public async Task GetPrivateArchivedThreadsAsync(ulong? before, int? limit) => await this.Discord.ApiClient.GetPrivateArchivedThreadsAsync(this.Id, before, limit); @@ -1118,10 +1118,10 @@ public ForumPostTag GetForumPostTag(ulong id) /// The emoji of the tag. Has to be either a of the current guild or a . /// Whether only moderators should be able to apply this tag. /// The audit log reason. - /// Thrown when the client does not have the permission. - /// Thrown when the tag does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the tag does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public async Task CreateForumPostTagAsync(string name, DiscordEmoji emoji, bool moderated = false, string reason = null) => await this.Discord.ApiClient.CreateForumTagAsync(this.Id, name, emoji, moderated, reason); @@ -1130,10 +1130,10 @@ public async Task CreateForumPostTagAsync(string name, DiscordEmoj /// /// The id of the tag to delete. /// The audit log reason. - /// Thrown when the client does not have the permission. - /// Thrown when the tag does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the tag does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task DeleteForumPostTag(ulong id, string reason = null) => this.Discord.ApiClient.DeleteForumTagAsync(id, this.Id, reason); @@ -1146,10 +1146,10 @@ public Task DeleteForumPostTag(ulong id, string reason = null) /// The permissions to allow. /// The permissions to deny. /// Reason for audit logs. - /// Thrown when the client does not have the permission. - /// Thrown when the channel does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the channel does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task AddOverwriteAsync(DiscordRole role, Permissions allow = Permissions.None, Permissions deny = Permissions.None, string reason = null) => this.Discord.ApiClient.EditChannelPermissionsAsync(this.Id, role.Id, allow, deny, "role", reason); @@ -1161,10 +1161,10 @@ public Task AddOverwriteAsync(DiscordRole role, Permissions allow = Permissions. /// The permissions to allow. /// The permissions to deny. /// Reason for audit logs. - /// Thrown when the client does not have the permission. - /// Thrown when the channel does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the channel does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task AddOverwriteAsync(DiscordMember member, Permissions allow = Permissions.None, Permissions deny = Permissions.None, string reason = null) => this.Discord.ApiClient.EditChannelPermissionsAsync(this.Id, member.Id, allow, deny, "member", reason); @@ -1173,10 +1173,10 @@ public Task AddOverwriteAsync(DiscordMember member, Permissions allow = Permissi /// /// The member to have the permission deleted. /// Reason for audit logs. - /// Thrown when the client does not have the permission. - /// Thrown when the channel does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the channel does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task DeleteOverwriteAsync(DiscordMember member, string reason = null) => this.Discord.ApiClient.DeleteChannelPermissionAsync(this.Id, member.Id, reason); @@ -1185,19 +1185,19 @@ public Task DeleteOverwriteAsync(DiscordMember member, string reason = null) /// /// The role to have the permission deleted. /// Reason for audit logs. - /// Thrown when the client does not have the permission. - /// Thrown when the channel does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the channel does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task DeleteOverwriteAsync(DiscordRole role, string reason = null) => this.Discord.ApiClient.DeleteChannelPermissionAsync(this.Id, role.Id, reason); /// /// Post a typing indicator. /// - /// Thrown when the channel does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the channel does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task TriggerTypingAsync() => !this.IsWritable() ? throw new ArgumentException("Cannot start typing in a non-text channel.") @@ -1206,10 +1206,10 @@ public Task TriggerTypingAsync() => /// /// Returns all pinned messages. /// - /// Thrown when the client does not have the permission. - /// Thrown when the channel does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the channel does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task> GetPinnedMessagesAsync() => !this.IsWritable() ? throw new ArgumentException("A non-text channel does not have pinned messages.") @@ -1221,10 +1221,10 @@ public Task> GetPinnedMessagesAsync() => /// The name of the webhook. /// The image for the default webhook avatar. /// Reason for audit logs. - /// Thrown when the client does not have the permission. - /// Thrown when the channel does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the channel does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public async Task CreateWebhookAsync(string name, Optional avatar = default, string reason = null) => await this.Discord.ApiClient.CreateWebhookAsync(this.IsThread() ? this.ParentId!.Value : this.Id, name, ImageTool.Base64FromStream(avatar), reason).ConfigureAwait(false); @@ -1232,9 +1232,9 @@ public async Task CreateWebhookAsync(string name, Optional /// Returns a list of webhooks. /// - /// Thrown when the client does not have the permission. - /// Thrown when the channel does not exist. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the channel does not exist. + /// Thrown when Discord is unable to process the request. public Task> GetWebhooksAsync() => this.Discord.ApiClient.GetChannelWebhooksAsync(this.IsThread() ? this.ParentId!.Value : this.Id); @@ -1242,10 +1242,10 @@ public Task> GetWebhooksAsync() /// Moves a member to this voice channel. /// /// The member to be moved. - /// Thrown when the client does not have the permission. - /// Thrown when the channel does not exists or if the Member does not exists. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the channel does not exists or if the Member does not exists. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public async Task PlaceMemberAsync(DiscordMember member) { if (!this.IsVoiceJoinable()) @@ -1259,8 +1259,8 @@ await this.Discord.ApiClient.ModifyGuildMemberAsync(this.Guild.Id, member.Id, de /// Follows a news channel. /// /// Channel to crosspost messages to. - /// Thrown when trying to follow a non-news channel. - /// Thrown when the current user doesn't have on the target channel. + /// Thrown when trying to follow a non-news channel. + /// Thrown when the current user doesn't have on the target channel. public Task FollowAsync(DiscordChannel targetChannel) => this.Type != ChannelType.News ? throw new ArgumentException("Cannot follow a non-news channel.") @@ -1270,8 +1270,8 @@ public Task FollowAsync(DiscordChannel targetChannel) => /// Publishes a message in a news channel to following channels. /// /// Message to publish. - /// Thrown when the message has already been crossposted. - /// + /// Thrown when the message has already been crossposted. + /// /// Thrown when the current user doesn't have and/or /// public Task CrosspostMessageAsync(DiscordMessage message) => @@ -1284,7 +1284,7 @@ public Task CrosspostMessageAsync(DiscordMessage message) => /// /// Toggles the suppress state. /// Sets the time the user requested to speak. - /// Thrown when the channel is not a stage channel. + /// Thrown when the channel is not a stage channel. public async Task UpdateCurrentUserVoiceStateAsync(bool? suppress, DateTimeOffset? requestToSpeakTimestamp = null) { if (this.Type != ChannelType.Stage) diff --git a/DisCatSharp/Entities/Channel/DiscordDmChannel.cs b/DisCatSharp/Entities/Channel/DiscordDmChannel.cs index 24e6b9e770..b81343aa23 100644 --- a/DisCatSharp/Entities/Channel/DiscordDmChannel.cs +++ b/DisCatSharp/Entities/Channel/DiscordDmChannel.cs @@ -73,9 +73,9 @@ public string IconUrl /// The id of the user to add. /// The OAuth2 access token. /// The nickname to give to the user. - /// Thrown when the channel does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the channel does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task AddDmRecipientAsync(ulong userId, string accessToken, string nickname) => this.Discord.ApiClient.AddGroupDmRecipientAsync(this.Id, userId, accessToken, nickname); @@ -84,9 +84,9 @@ public Task AddDmRecipientAsync(ulong userId, string accessToken, string nicknam /// /// The id of the User to remove. /// The OAuth2 access token. - /// Thrown when the channel does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the channel does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task RemoveDmRecipientAsync(ulong userId, string accessToken) => this.Discord.ApiClient.RemoveGroupDmRecipientAsync(this.Id, userId); } diff --git a/DisCatSharp/Entities/Channel/Overwrite/DiscordOverwrite.cs b/DisCatSharp/Entities/Channel/Overwrite/DiscordOverwrite.cs index 71c61516db..f847dea21a 100644 --- a/DisCatSharp/Entities/Channel/Overwrite/DiscordOverwrite.cs +++ b/DisCatSharp/Entities/Channel/Overwrite/DiscordOverwrite.cs @@ -60,10 +60,10 @@ public class DiscordOverwrite : SnowflakeObject /// Deletes this channel overwrite. /// /// Reason as to why this overwrite gets deleted. - /// Thrown when the client does not have the permission. - /// Thrown when the overwrite does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the overwrite does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task DeleteAsync(string reason = null) => this.Discord.ApiClient.DeleteChannelPermissionAsync(this.ChannelId, this.Id, reason); /// @@ -72,10 +72,10 @@ public class DiscordOverwrite : SnowflakeObject /// Permissions that are allowed. /// Permissions that are denied. /// Reason as to why you made this change. - /// Thrown when the client does not have the permission. - /// Thrown when the overwrite does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the overwrite does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task UpdateAsync(Permissions? allow = null, Permissions? deny = null, string reason = null) => this.Discord.ApiClient.EditChannelPermissionsAsync(this.ChannelId, this.Id, allow ?? this.Allowed, deny ?? this.Denied, this.Type.ToString().ToLowerInvariant(), reason); @@ -83,10 +83,10 @@ public Task UpdateAsync(Permissions? allow = null, Permissions? deny = null, str /// Gets the DiscordMember that is affected by this overwrite. /// /// The DiscordMember that is affected by this overwrite - /// Thrown when the client does not have the permission. - /// Thrown when the overwrite does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the overwrite does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public async Task GetMemberAsync() => this.Type != OverwriteType.Member ? throw new ArgumentException(nameof(this.Type), "This overwrite is for a role, not a member.") @@ -96,9 +96,9 @@ public async Task GetMemberAsync() => /// Gets the DiscordRole that is affected by this overwrite. /// /// The DiscordRole that is affected by this overwrite - /// Thrown when the role does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the role does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public async Task GetRoleAsync() => this.Type != OverwriteType.Role ? throw new ArgumentException(nameof(this.Type), "This overwrite is for a member, not a role.") diff --git a/DisCatSharp/Entities/DiscordUri.cs b/DisCatSharp/Entities/DiscordUri.cs index 95eefc0385..3ef455f2d2 100644 --- a/DisCatSharp/Entities/DiscordUri.cs +++ b/DisCatSharp/Entities/DiscordUri.cs @@ -87,11 +87,11 @@ internal DiscordUri(string value) public override string ToString() => this._value.ToString(); /// - /// Converts this DiscordUri into a canonical representation of a if it can be represented as + /// Converts this DiscordUri into a canonical representation of a if it can be represented as /// such, throwing an exception otherwise. /// /// A canonical representation of this DiscordUri. - /// If is not , as + /// If is not , as /// that would mean creating an invalid Uri, which would result in loss of data. public Uri ToUri() => this.Type == DiscordUriType.Standard @@ -148,7 +148,7 @@ public override object ReadJson(JsonReader reader, Type objectType, object exist public enum DiscordUriType : byte { /// - /// Represents a URI that conforms to RFC 3986, meaning it's stored internally as a and will + /// Represents a URI that conforms to RFC 3986, meaning it's stored internally as a and will /// contain a trailing slash after the domain name. /// Standard, diff --git a/DisCatSharp/Entities/Guild/DiscordGuild.AuditLog.cs b/DisCatSharp/Entities/Guild/DiscordGuild.AuditLog.cs index 2fb98ea376..d1c3ee3895 100644 --- a/DisCatSharp/Entities/Guild/DiscordGuild.AuditLog.cs +++ b/DisCatSharp/Entities/Guild/DiscordGuild.AuditLog.cs @@ -47,8 +47,8 @@ public partial class DiscordGuild /// Filter by member responsible. /// Filter by action type. /// A collection of requested audit log entries. - /// Thrown when the client does not have the permission. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when Discord is unable to process the request. public async Task> GetAuditLogsAsync(int? limit = null, DiscordMember byMember = null, AuditLogActionType? actionType = null) { var alrs = new List(); diff --git a/DisCatSharp/Entities/Guild/DiscordGuild.cs b/DisCatSharp/Entities/Guild/DiscordGuild.cs index 2f4cd19f13..4f7c0173e1 100644 --- a/DisCatSharp/Entities/Guild/DiscordGuild.cs +++ b/DisCatSharp/Entities/Guild/DiscordGuild.cs @@ -678,10 +678,10 @@ public Task> SearchMembersAsync(string name, int? l /// new roles /// whether this user has to be muted /// whether this user has to be deafened - /// Thrown when the client does not have the permission. - /// Thrown when the or is not found. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the or is not found. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task AddMemberAsync(DiscordUser user, string accessToken, string nickname = null, IEnumerable roles = null, bool muted = false, bool deaf = false) => this.Discord.ApiClient.AddGuildMemberAsync(this.Id, user.Id, accessToken, nickname, roles, muted, deaf); @@ -689,8 +689,8 @@ public Task AddMemberAsync(DiscordUser user, string accessToken, string nickname /// /// Deletes this guild. Requires the caller to be the owner of the guild. /// - /// Thrown when the client is not the owner of the guild. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client is not the owner of the guild. + /// Thrown when Discord is unable to process the request. public Task DeleteAsync() => this.Discord.ApiClient.DeleteGuildAsync(this.Id); @@ -698,9 +698,9 @@ public Task DeleteAsync() /// Enables the mfa requirement for this guild. /// /// The audit log reason. - /// Thrown when the current user is not the guilds owner. - /// Thrown when the guild does not exist. - /// Thrown when Discord is unable to process the request. + /// Thrown when the current user is not the guilds owner. + /// Thrown when the guild does not exist. + /// Thrown when Discord is unable to process the request. public Task EnableMfaAsync(string reason = null) => this.IsOwner ? this.Discord.ApiClient.EnableGuildMfaAsync(this.Id, reason) : throw new Exception("The current user does not own the guild."); @@ -708,9 +708,9 @@ public Task EnableMfaAsync(string reason = null) /// Disables the mfa requirement for this guild. /// /// The audit log reason. - /// Thrown when the current user is not the guilds owner. - /// Thrown when the guild does not exist. - /// Thrown when Discord is unable to process the request. + /// Thrown when the current user is not the guilds owner. + /// Thrown when the guild does not exist. + /// Thrown when Discord is unable to process the request. public Task DisableMfaAsync(string reason = null) => this.IsOwner ? this.Discord.ApiClient.DisableGuildMfaAsync(this.Id, reason) : throw new Exception("The current user does not own the guild."); @@ -720,10 +720,10 @@ public Task DisableMfaAsync(string reason = null) /// /// Action to perform on this guild. /// The modified guild object. - /// Thrown when the client does not have the permission. - /// Thrown when the guild does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the guild does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public async Task ModifyAsync(Action action) { var mdl = new GuildEditModel(); @@ -766,10 +766,10 @@ public async Task ModifyAsync(Action action) /// The description. /// The default message notifications. Defaults to /// The audit log reason. - /// Thrown when the client does not have the permission. - /// Thrown when the guild does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the guild does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public async Task ModifyCommunitySettingsAsync(bool enabled, DiscordChannel rulesChannel = null, DiscordChannel publicUpdatesChannel = null, string preferredLocale = "en-US", string description = null, DefaultMessageNotifications defaultMessageNotifications = DefaultMessageNotifications.MentionsOnly, string reason = null) { var verificationLevel = this.VerificationLevel; @@ -808,10 +808,10 @@ public async Task ModifyCommunitySettingsAsync(bool enabled, Disco /// Enables invites for the guild. /// /// The audit log reason. - /// Thrown when the client does not have the permission. - /// Thrown when the guild does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the guild does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public async Task EnableInvitesAsync(string reason = null) { List features = new(); @@ -828,10 +828,10 @@ public async Task EnableInvitesAsync(string reason = null) /// /// /// - /// Thrown when the client does not have the permission. - /// Thrown when the guild does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the guild does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public async Task DisableInvitesAsync(string reason = null) { List features = new(); @@ -849,10 +849,10 @@ public async Task DisableInvitesAsync(string reason = null) /// Member to timeout. /// The datetime offset to time out the user. Up to 28 days. /// Reason for audit logs. - /// Thrown when the client does not have the permission. - /// Thrown when the member does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the member does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task TimeoutAsync(ulong memberId, DateTimeOffset until, string reason = null) => until.Subtract(DateTimeOffset.UtcNow).Days > 28 ? throw new ArgumentException("Timeout can not be longer than 28 days") @@ -864,10 +864,10 @@ public Task TimeoutAsync(ulong memberId, DateTimeOffset until, string reason = n /// Member to timeout. /// The timespan to time out the user. Up to 28 days. /// Reason for audit logs. - /// Thrown when the client does not have the permission. - /// Thrown when the member does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the member does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task TimeoutAsync(ulong memberId, TimeSpan until, string reason = null) => this.TimeoutAsync(memberId, DateTimeOffset.UtcNow + until, reason); @@ -877,10 +877,10 @@ public Task TimeoutAsync(ulong memberId, TimeSpan until, string reason = null) /// Member to timeout. /// The datetime to time out the user. Up to 28 days. /// Reason for audit logs. - /// Thrown when the client does not have the permission. - /// Thrown when the member does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the member does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task TimeoutAsync(ulong memberId, DateTime until, string reason = null) => this.TimeoutAsync(memberId, until.ToUniversalTime() - DateTime.UtcNow, reason); @@ -889,10 +889,10 @@ public Task TimeoutAsync(ulong memberId, DateTime until, string reason = null) /// /// Member to remove the timeout from. /// Reason for audit logs. - /// Thrown when the client does not have the permission. - /// Thrown when the member does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the member does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task RemoveTimeoutAsync(ulong memberId, string reason = null) => this.Discord.ApiClient.ModifyTimeoutAsync(this.Id, memberId, null, reason); @@ -902,10 +902,10 @@ public Task RemoveTimeoutAsync(ulong memberId, string reason = null) /// Member to ban. /// How many days to remove messages from. /// Reason for audit logs. - /// Thrown when the client does not have the permission. - /// Thrown when the member does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the member does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task BanMemberAsync(DiscordMember member, int deleteMessageDays = 0, string reason = null) => this.Discord.ApiClient.CreateGuildBanAsync(this.Id, member.Id, deleteMessageDays, reason); @@ -915,10 +915,10 @@ public Task BanMemberAsync(DiscordMember member, int deleteMessageDays = 0, stri /// ID of the user to ban. /// How many days to remove messages from. /// Reason for audit logs. - /// Thrown when the client does not have the permission. - /// Thrown when the member does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the member does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task BanMemberAsync(ulong userId, int deleteMessageDays = 0, string reason = null) => this.Discord.ApiClient.CreateGuildBanAsync(this.Id, userId, deleteMessageDays, reason); @@ -927,10 +927,10 @@ public Task BanMemberAsync(ulong userId, int deleteMessageDays = 0, string reaso /// /// User to unban. /// Reason for audit logs. - /// Thrown when the client does not have the permission. - /// Thrown when the user does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the user does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task UnbanMemberAsync(DiscordUser user, string reason = null) => this.Discord.ApiClient.RemoveGuildBanAsync(this.Id, user.Id, reason); @@ -939,17 +939,17 @@ public Task UnbanMemberAsync(DiscordUser user, string reason = null) /// /// ID of the user to unban. /// Reason for audit logs. - /// Thrown when the client does not have the permission. - /// Thrown when the user does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the user does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task UnbanMemberAsync(ulong userId, string reason = null) => this.Discord.ApiClient.RemoveGuildBanAsync(this.Id, userId, reason); /// /// Leaves this guild. /// - /// Thrown when Discord is unable to process the request. + /// Thrown when Discord is unable to process the request. public Task LeaveAsync() => this.Discord.ApiClient.LeaveGuildAsync(this.Id); @@ -960,8 +960,8 @@ public Task LeaveAsync() /// The Id of the user before which to fetch the bans. Overrides if both are present. /// The Id of the user after which to fetch the bans. /// Collection of bans in this guild in ascending order by user id. - /// Thrown when the client does not have the permission. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when Discord is unable to process the request. public Task> GetBansAsync(int? limit = null, ulong? before = null, ulong? after = null) => this.Discord.ApiClient.GetGuildBansAsync(this.Id, limit, before, after); @@ -970,7 +970,7 @@ public Task> GetBansAsync(int? limit = null, ulong? be /// /// The Id of the user to get the ban for. /// The requested ban object. - /// Thrown when the specified user is not banned. + /// Thrown when the specified user is not banned. public Task GetBanAsync(ulong userId) => this.Discord.ApiClient.GetGuildBanAsync(this.Id, userId); @@ -979,7 +979,7 @@ public Task GetBanAsync(ulong userId) /// /// The user to get the ban for. /// The requested ban object. - /// Thrown when the specified user is not banned. + /// Thrown when the specified user is not banned. public Task GetBanAsync(DiscordUser user) => this.GetBanAsync(user.Id); @@ -998,9 +998,9 @@ public Task GetBanAsync(DiscordUser user) /// The cover image. /// The reason. /// A scheduled event. - /// Thrown when the guild does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the guild does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public async Task CreateScheduledEventAsync(string name, DateTimeOffset scheduledStartTime, DateTimeOffset? scheduledEndTime = null, DiscordChannel channel = null, DiscordScheduledEventEntityMetadata metadata = null, string description = null, ScheduledEventEntityType type = ScheduledEventEntityType.StageInstance, Optional coverImage = default, string reason = null) { var coverb64 = ImageTool.Base64FromStream(coverImage); @@ -1018,9 +1018,9 @@ public async Task CreateScheduledEventAsync(string name, /// The cover image. /// The reason. /// A scheduled event. - /// Thrown when the guild does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the guild does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public async Task CreateExternalScheduledEventAsync(string name, DateTimeOffset scheduledStartTime, DateTimeOffset scheduledEndTime, string location, string description = null, Optional coverImage = default, string reason = null) { var coverb64 = ImageTool.Base64FromStream(coverImage); @@ -1034,9 +1034,9 @@ public async Task CreateExternalScheduledEventAsync(strin /// The Id of the event to get. /// Whether to include user count. /// A scheduled event. - /// Thrown when the guild does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the guild does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public async Task GetScheduledEventAsync(ulong scheduledEventId, bool? withUserCount = null) => this.ScheduledEventsInternal.TryGetValue(scheduledEventId, out var ev) ? ev : await this.Discord.ApiClient.GetGuildScheduledEventAsync(this.Id, scheduledEventId, withUserCount); @@ -1046,9 +1046,9 @@ public async Task GetScheduledEventAsync(ulong scheduledE /// The event to get. /// Whether to include user count. /// A scheduled event. - /// Thrown when the guild does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the guild does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public async Task GetScheduledEventAsync(DiscordScheduledEvent scheduledEvent, bool? withUserCount = null) => await this.GetScheduledEventAsync(scheduledEvent.Id, withUserCount); @@ -1057,9 +1057,9 @@ public async Task GetScheduledEventAsync(DiscordScheduled /// /// Whether to include user count. /// A list of the guilds scheduled events. - /// Thrown when the guild does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the guild does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public async Task> GetScheduledEventsAsync(bool? withUserCount = null) => await this.Discord.ApiClient.ListGuildScheduledEventsAsync(this.Id, withUserCount); #endregion @@ -1076,10 +1076,10 @@ public async Task> GetSchedule /// The default auto archive duration for new threads. /// Reason for audit logs. /// The newly-created channel. - /// Thrown when the client does not have the permission. - /// Thrown when the guild does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the guild does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task CreateTextChannelAsync(string name, DiscordChannel parent = null, Optional topic = default, IEnumerable overwrites = null, bool? nsfw = null, Optional perUserRateLimit = default, ThreadAutoArchiveDuration defaultAutoArchiveDuration = ThreadAutoArchiveDuration.OneDay, string reason = null) => this.CreateChannelAsync(name, ChannelType.Text, parent, topic, null, null, overwrites, nsfw, perUserRateLimit, null, defaultAutoArchiveDuration, reason); @@ -1098,10 +1098,10 @@ public Task CreateTextChannelAsync(string name, DiscordChannel p /// The default auto archive duration for new threads. /// Reason for audit logs. /// The newly-created channel. - /// Thrown when the client does not have the permission or the guild does not have the forum channel feature. - /// Thrown when the guild does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission or the guild does not have the forum channel feature. + /// Thrown when the guild does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task CreateForumChannelAsync(string name, DiscordChannel parent = null, Optional topic = default, IEnumerable overwrites = null, bool? nsfw = null, Optional defaultReactionEmoji = default, Optional perUserRateLimit = default, Optional postCreateUserRateLimit = default, ThreadAutoArchiveDuration defaultAutoArchiveDuration = ThreadAutoArchiveDuration.OneDay, string reason = null) => this.Discord.ApiClient.CreateForumChannelAsync(this.Id, name, parent?.Id, topic, null, nsfw, defaultReactionEmoji, perUserRateLimit, postCreateUserRateLimit, defaultAutoArchiveDuration, overwrites, reason); @@ -1112,10 +1112,10 @@ public Task CreateForumChannelAsync(string name, DiscordChannel /// Permission overwrites for this category. /// Reason for audit logs. /// The newly-created channel category. - /// Thrown when the client does not have the permission. - /// Thrown when the guild does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the guild does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task CreateChannelCategoryAsync(string name, IEnumerable overwrites = null, string reason = null) => this.CreateChannelAsync(name, ChannelType.Category, null, Optional.None, null, null, overwrites, null, Optional.None, null, null, reason); @@ -1126,11 +1126,11 @@ public Task CreateChannelCategoryAsync(string name, IEnumerable< /// Permission overwrites for this stage channel. /// Reason for audit logs. /// The newly-created stage channel. - /// Thrown when the client does not have the . - /// Thrown when the guild does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. - /// Thrown when the guilds has not enabled community. + /// Thrown when the client does not have the . + /// Thrown when the guild does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. + /// Thrown when the guilds has not enabled community. public Task CreateStageChannelAsync(string name, IEnumerable overwrites = null, string reason = null) => this.Features.HasCommunityEnabled ? this.CreateChannelAsync(name, ChannelType.Stage, null, Optional.None, null, null, overwrites, null, Optional.None, null, null, reason) : throw new NotSupportedException("Guild has not enabled community. Can not create a stage channel."); @@ -1142,11 +1142,11 @@ public Task CreateStageChannelAsync(string name, IEnumerableThe default auto archive duration for new threads. /// Reason for audit logs. /// The newly-created news channel. - /// Thrown when the client does not have the . - /// Thrown when the guild does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. - /// Thrown when the guilds has not enabled community. + /// Thrown when the client does not have the . + /// Thrown when the guild does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. + /// Thrown when the guilds has not enabled community. public Task CreateNewsChannelAsync(string name, IEnumerable overwrites = null, string reason = null, ThreadAutoArchiveDuration defaultAutoArchiveDuration = ThreadAutoArchiveDuration.OneDay) => this.Features.HasCommunityEnabled ? this.CreateChannelAsync(name, ChannelType.News, null, Optional.None, null, null, overwrites, null, Optional.None, null, defaultAutoArchiveDuration, reason) : throw new NotSupportedException("Guild has not enabled community. Can not create a news channel."); @@ -1161,10 +1161,10 @@ public Task CreateNewsChannelAsync(string name, IEnumerableVideo quality mode of the channel. /// Reason for audit logs. /// The newly-created channel. - /// Thrown when the client does not have the permission. - /// Thrown when the guild does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the guild does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task CreateVoiceChannelAsync(string name, DiscordChannel parent = null, int? bitrate = null, int? userLimit = null, IEnumerable overwrites = null, VideoQualityMode? qualityMode = null, string reason = null) => this.CreateChannelAsync(name, ChannelType.Voice, parent, Optional.None, bitrate, userLimit, overwrites, null, Optional.None, qualityMode, null, reason); @@ -1184,10 +1184,10 @@ public Task CreateVoiceChannelAsync(string name, DiscordChannel /// The default auto archive duration for new threads. /// Reason for audit logs. /// The newly-created channel. - /// Thrown when the client does not have the permission. - /// Thrown when the guild does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the guild does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task CreateChannelAsync(string name, ChannelType type, DiscordChannel parent = null, Optional topic = default, int? bitrate = null, int? userLimit = null, IEnumerable overwrites = null, bool? nsfw = null, Optional perUserRateLimit = default, VideoQualityMode? qualityMode = null, ThreadAutoArchiveDuration? defaultAutoArchiveDuration = null, string reason = null) => // technically you can create news/store channels but not always type != ChannelType.Text && type != ChannelType.Voice && type != ChannelType.Category && type != ChannelType.News && type != ChannelType.Store && type != ChannelType.Stage @@ -1200,9 +1200,9 @@ public Task CreateChannelAsync(string name, ChannelType type, Di /// Gets active threads. Can contain more threads. /// If the result's value 'HasMore' is true, you need to recall this function to get older threads. /// - /// Thrown when the thread does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the thread does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task GetActiveThreadsAsync() => this.Discord.ApiClient.GetActiveThreadsAsync(this.Id); @@ -1223,10 +1223,10 @@ public Task DeleteAllChannelsAsync() /// Minimum number of inactivity days required for users to be pruned. Defaults to 7. /// The roles to be included in the prune. /// Number of users that will be pruned. - /// Thrown when the client does not have the permission. - /// Thrown when the guild does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the guild does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task GetPruneCountAsync(int days = 7, IEnumerable includedRoles = null) { if (includedRoles != null) @@ -1250,10 +1250,10 @@ public Task GetPruneCountAsync(int days = 7, IEnumerable inclu /// The roles to be included in the prune. /// Reason for audit logs. /// Number of users pruned. - /// Thrown when the client does not have the permission. - /// Thrown when the guild does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the guild does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task PruneAsync(int days = 7, bool computePruneCount = true, IEnumerable includedRoles = null, string reason = null) { if (includedRoles != null) @@ -1273,10 +1273,10 @@ public Task GetPruneCountAsync(int days = 7, IEnumerable inclu /// Gets integrations attached to this guild. /// /// Collection of integrations attached to this guild. - /// Thrown when the client does not have the permission. - /// Thrown when the guild does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the guild does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task> GetIntegrationsAsync() => this.Discord.ApiClient.GetGuildIntegrationsAsync(this.Id); @@ -1285,10 +1285,10 @@ public Task> GetIntegrationsAsync() /// /// Integration to attach. /// The integration after being attached to the guild. - /// Thrown when the client does not have the permission. - /// Thrown when the guild does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the guild does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task AttachUserIntegrationAsync(DiscordIntegration integration) => this.Discord.ApiClient.CreateGuildIntegrationAsync(this.Id, integration.Type, integration.Id); @@ -1300,10 +1300,10 @@ public Task AttachUserIntegrationAsync(DiscordIntegration in /// Length of grace period which allows for renewing the integration. /// Whether emotes should be synced from this integration. /// The modified integration. - /// Thrown when the client does not have the permission. - /// Thrown when the guild does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the guild does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task ModifyIntegrationAsync(DiscordIntegration integration, int expireBehaviour, int expireGracePeriod, bool enableEmoticons) => this.Discord.ApiClient.ModifyGuildIntegrationAsync(this.Id, integration.Id, expireBehaviour, expireGracePeriod, enableEmoticons); @@ -1311,10 +1311,10 @@ public Task ModifyIntegrationAsync(DiscordIntegration integr /// Removes an integration from this guild. /// /// Integration to remove. - /// Thrown when the client does not have the permission. - /// Thrown when the guild does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the guild does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task DeleteIntegrationAsync(DiscordIntegration integration) => this.Discord.ApiClient.DeleteGuildIntegrationAsync(this.Id, integration); @@ -1322,10 +1322,10 @@ public Task DeleteIntegrationAsync(DiscordIntegration integration) /// Forces re-synchronization of an integration for this guild. /// /// Integration to synchronize. - /// Thrown when the client does not have the permission. - /// Thrown when the guild does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the guild does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task SyncIntegrationAsync(DiscordIntegration integration) => this.Discord.ApiClient.SyncGuildIntegrationAsync(this.Id, integration.Id); @@ -1333,7 +1333,7 @@ public Task SyncIntegrationAsync(DiscordIntegration integration) /// Gets the voice regions for this guild. /// /// Voice regions available for this guild. - /// Thrown when Discord is unable to process the request. + /// Thrown when Discord is unable to process the request. public async Task> ListVoiceRegionsAsync() { var vrs = await this.Discord.ApiClient.GetGuildVoiceRegionsAsync(this.Id).ConfigureAwait(false); @@ -1355,7 +1355,7 @@ public DiscordInvite GetInvite(string code) /// Gets all the invites created for all the channels in this guild. /// /// A collection of invites. - /// Thrown when Discord is unable to process the request. + /// Thrown when Discord is unable to process the request. public async Task> GetInvitesAsync() { var res = await this.Discord.ApiClient.GetGuildInvitesAsync(this.Id).ConfigureAwait(false); @@ -1375,8 +1375,8 @@ public async Task> GetInvitesAsync() /// Gets the vanity invite for this guild. /// /// A partial vanity invite. - /// Thrown when the client does not have the permission. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when Discord is unable to process the request. public Task GetVanityInviteAsync() => this.Discord.ApiClient.GetGuildVanityUrlAsync(this.Id); @@ -1384,8 +1384,8 @@ public Task GetVanityInviteAsync() /// Gets all the webhooks created for all the channels in this guild. /// /// A collection of webhooks this guild has. - /// Thrown when the client does not have the permission. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when Discord is unable to process the request. public Task> GetWebhooksAsync() => this.Discord.ApiClient.GetGuildWebhooksAsync(this.Id); @@ -1412,7 +1412,7 @@ public string GetWidgetImage(WidgetType bannerType = WidgetType.Shield) /// /// ID of the member to get. /// The requested member. - /// Thrown when Discord is unable to process the request. + /// Thrown when Discord is unable to process the request. public async Task GetMemberAsync(ulong userId, bool fetch = false) { if (!fetch && this.MembersInternal != null && this.MembersInternal.TryGetValue(userId, out var mbr)) @@ -1437,7 +1437,7 @@ public async Task GetMemberAsync(ulong userId, bool fetch = false /// Retrieves a full list of members from Discord. This method will bypass cache. /// /// A collection of all members in this guild. - /// Thrown when Discord is unable to process the request. + /// Thrown when Discord is unable to process the request. public async Task> GetAllMembersAsync() { var recmbr = new HashSet(); @@ -1516,7 +1516,7 @@ public async Task RequestMembersAsync(string query = "", int limit = 0, bool? pr /// Gets all the channels this guild has. /// /// A collection of this guild's channels. - /// Thrown when Discord is unable to process the request. + /// Thrown when Discord is unable to process the request. public Task> GetChannelsAsync() => this.Discord.ApiClient.GetGuildChannelsAsync(this.Id); @@ -1530,8 +1530,8 @@ public Task> GetChannelsAsync() /// Whether the role is to be mentionable. /// Reason for audit logs. /// The newly-created role. - /// Thrown when the client does not have the permission. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when Discord is unable to process the request. public Task CreateRoleAsync(string name = null, Permissions? permissions = null, DiscordColor? color = null, bool? hoist = null, bool? mentionable = null, string reason = null) => this.Discord.ApiClient.CreateGuildRoleAsync(this.Id, name, permissions, color?.Value, hoist, mentionable, reason); @@ -1540,7 +1540,7 @@ public Task CreateRoleAsync(string name = null, Permissions? permis /// /// ID of the role to get. /// Requested role. - /// Thrown when Discord is unable to process the request. + /// Thrown when Discord is unable to process the request. public DiscordRole GetRole(ulong id) => this.RolesInternal.TryGetValue(id, out var role) ? role : null; @@ -1549,7 +1549,7 @@ public DiscordRole GetRole(ulong id) /// /// ID of the channel to get. /// Requested channel. - /// Thrown when Discord is unable to process the request. + /// Thrown when Discord is unable to process the request. public DiscordChannel GetChannel(ulong id) => this.ChannelsInternal != null && this.ChannelsInternal.TryGetValue(id, out var channel) ? channel : null; @@ -1558,7 +1558,7 @@ public DiscordChannel GetChannel(ulong id) /// /// ID of the thread to get. /// Requested thread. - /// Thrown when Discord is unable to process the request. + /// Thrown when Discord is unable to process the request. public DiscordThreadChannel GetThread(ulong id) => this.ThreadsInternal != null && this.ThreadsInternal.TryGetValue(id, out var thread) ? thread : null; @@ -1566,7 +1566,7 @@ public DiscordThreadChannel GetThread(ulong id) /// Gets all of this guild's custom emojis. /// /// All of this guild's custom emojis. - /// Thrown when Discord is unable to process the request. + /// Thrown when Discord is unable to process the request. public Task> GetEmojisAsync() => this.Discord.ApiClient.GetGuildEmojisAsync(this.Id); @@ -1575,7 +1575,7 @@ public Task> GetEmojisAsync() /// /// ID of the emoji to get. /// The requested custom emoji. - /// Thrown when Discord is unable to process the request. + /// Thrown when Discord is unable to process the request. public Task GetEmojiAsync(ulong id) => this.Discord.ApiClient.GetGuildEmojiAsync(this.Id, id); @@ -1587,8 +1587,8 @@ public Task GetEmojiAsync(ulong id) /// Roles for which the emoji will be available. This works only if your application is whitelisted as integration. /// Reason for audit log. /// The newly-created emoji. - /// Thrown when the client does not have the permission. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when Discord is unable to process the request. public Task CreateEmojiAsync(string name, Stream image, IEnumerable roles = null, string reason = null) { if (string.IsNullOrWhiteSpace(name)) @@ -1614,8 +1614,8 @@ public Task CreateEmojiAsync(string name, Stream image, IEnum /// Roles for which the emoji will be available. This works only if your application is whitelisted as integration. /// Reason for audit log. /// The modified emoji. - /// Thrown when the client does not have the permission. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when Discord is unable to process the request. public Task ModifyEmojiAsync(DiscordGuildEmoji emoji, string name, IEnumerable roles = null, string reason = null) { if (emoji == null) @@ -1638,8 +1638,8 @@ public Task ModifyEmojiAsync(DiscordGuildEmoji emoji, string /// /// Emoji to delete. /// Reason for audit log. - /// Thrown when the client does not have the permission. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when Discord is unable to process the request. public Task DeleteEmojiAsync(DiscordGuildEmoji emoji, string reason = null) => emoji == null ? throw new ArgumentNullException(nameof(emoji)) @@ -1651,7 +1651,7 @@ public Task DeleteEmojiAsync(DiscordGuildEmoji emoji, string reason = null) => /// Gets all of this guild's custom stickers. /// /// All of this guild's custom stickers. - /// Thrown when Discord is unable to process the request. + /// Thrown when Discord is unable to process the request. public async Task> GetStickersAsync() { var stickers = await this.Discord.ApiClient.GetGuildStickersAsync(this.Id); @@ -1673,10 +1673,10 @@ public async Task> GetStickersAsync() /// /// Gets a sticker /// - /// Thrown when the sticker could not be found. - /// Thrown when the client does not have the permission. - /// Thrown when Discord is unable to process the request. - /// Sticker does not belong to a guild. + /// Thrown when the sticker could not be found. + /// Thrown when the client does not have the permission. + /// Thrown when Discord is unable to process the request. + /// Sticker does not belong to a guild. public Task GetStickerAsync(ulong stickerId) => this.Discord.ApiClient.GetGuildStickerAsync(this.Id, stickerId); @@ -1689,8 +1689,8 @@ public Task GetStickerAsync(ulong stickerId) /// The file format the sticker is written in. /// The sticker. /// Audit log reason - /// Thrown when the client does not have the permission. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when Discord is unable to process the request. public Task CreateStickerAsync(string name, string description, DiscordEmoji emoji, Stream file, StickerFormat format, string reason = null) { var fileExt = format switch @@ -1727,10 +1727,10 @@ public Task CreateStickerAsync(string name, string description, /// The emoji to associate with this sticker. /// Audit log reason /// A sticker object - /// Thrown when the sticker could not be found. - /// Thrown when the client does not have the permission. - /// Thrown when Discord is unable to process the request. - /// Sticker does not belong to a guild. + /// Thrown when the sticker could not be found. + /// Thrown when the client does not have the permission. + /// Thrown when Discord is unable to process the request. + /// Sticker does not belong to a guild. public async Task ModifyStickerAsync(ulong sticker, Optional name, Optional description, Optional emoji, string reason = null) { if (!this.StickersInternal.TryGetValue(sticker, out var stickerobj) || stickerobj.Guild.Id != this.Id) @@ -1764,10 +1764,10 @@ public async Task ModifyStickerAsync(ulong sticker, OptionalThe emoji to associate with this sticker. /// Audit log reason /// A sticker object - /// Thrown when the sticker could not be found. - /// Thrown when the client does not have the permission. - /// Thrown when Discord is unable to process the request. - /// Sticker does not belong to a guild. + /// Thrown when the sticker could not be found. + /// Thrown when the client does not have the permission. + /// Thrown when Discord is unable to process the request. + /// Sticker does not belong to a guild. public Task ModifyStickerAsync(DiscordSticker sticker, Optional name, Optional description, Optional emoji, string reason = null) => this.ModifyStickerAsync(sticker.Id, name, description, emoji, reason); @@ -1776,10 +1776,10 @@ public Task ModifyStickerAsync(DiscordSticker sticker, Optional< /// /// Id of sticker to delete /// Audit log reason - /// Thrown when the sticker could not be found. - /// Thrown when the client does not have the permission. - /// Thrown when Discord is unable to process the request. - /// Sticker does not belong to a guild. + /// Thrown when the sticker could not be found. + /// Thrown when the client does not have the permission. + /// Thrown when Discord is unable to process the request. + /// Sticker does not belong to a guild. public Task DeleteStickerAsync(ulong sticker, string reason = null) => !this.StickersInternal.TryGetValue(sticker, out var stickerobj) ? throw new ArgumentNullException(nameof(sticker)) @@ -1792,10 +1792,10 @@ public Task DeleteStickerAsync(ulong sticker, string reason = null) => /// /// Sticker to delete /// Audit log reason - /// Thrown when the sticker could not be found. - /// Thrown when the client does not have the permission. - /// Thrown when Discord is unable to process the request. - /// Sticker does not belong to a guild. + /// Thrown when the sticker could not be found. + /// Thrown when the client does not have the permission. + /// Thrown when Discord is unable to process the request. + /// Sticker does not belong to a guild. public Task DeleteStickerAsync(DiscordSticker sticker, string reason = null) => this.DeleteStickerAsync(sticker.Id, reason); @@ -1804,7 +1804,7 @@ public Task DeleteStickerAsync(DiscordSticker sticker, string reason = null) /// Default channel is the first channel current member can see. /// /// This member's default guild. - /// Thrown when Discord is unable to process the request. + /// Thrown when Discord is unable to process the request. public DiscordChannel GetDefaultChannel() => this.ChannelsInternal?.Values.Where(xc => xc.Type == ChannelType.Text) .OrderBy(xc => xc.Position) @@ -1838,8 +1838,8 @@ public Task ModifyWidgetSettingsAsync(bool? isEnabled = n /// Gets all of this guild's templates. /// /// All of the guild's templates. - /// Throws when the client does not have the permission. - /// Thrown when Discord is unable to process the request. + /// Throws when the client does not have the permission. + /// Thrown when Discord is unable to process the request. public Task> GetTemplatesAsync() => this.Discord.ApiClient.GetGuildTemplatesAsync(this.Id); @@ -1849,9 +1849,9 @@ public Task> GetTemplatesAsync() /// Name of the template. /// Description of the template. /// The template created. - /// Throws when a template already exists for the guild or a null parameter is provided for the name. - /// Throws when the client does not have the permission. - /// Thrown when Discord is unable to process the request. + /// Throws when a template already exists for the guild or a null parameter is provided for the name. + /// Throws when the client does not have the permission. + /// Thrown when Discord is unable to process the request. public Task CreateTemplateAsync(string name, string description = null) => this.Discord.ApiClient.CreateGuildTemplateAsync(this.Id, name, description); @@ -1860,9 +1860,9 @@ public Task CreateTemplateAsync(string name, string descri /// /// The code of the template to sync. /// The template synced. - /// Throws when the template for the code cannot be found - /// Throws when the client does not have the permission. - /// Thrown when Discord is unable to process the request. + /// Throws when the template for the code cannot be found + /// Throws when the client does not have the permission. + /// Thrown when Discord is unable to process the request. public Task SyncTemplateAsync(string code) => this.Discord.ApiClient.SyncGuildTemplateAsync(this.Id, code); @@ -1873,9 +1873,9 @@ public Task SyncTemplateAsync(string code) /// Name of the template. /// Description of the template. /// The template modified. - /// Throws when the template for the code cannot be found - /// Throws when the client does not have the permission. - /// Thrown when Discord is unable to process the request. + /// Throws when the template for the code cannot be found + /// Throws when the client does not have the permission. + /// Thrown when Discord is unable to process the request. public Task ModifyTemplateAsync(string code, string name = null, string description = null) => this.Discord.ApiClient.ModifyGuildTemplateAsync(this.Id, code, name, description); @@ -1884,9 +1884,9 @@ public Task ModifyTemplateAsync(string code, string name = /// /// The code of the template to delete. /// The deleted template. - /// Throws when the template for the code cannot be found - /// Throws when the client does not have the permission. - /// Thrown when Discord is unable to process the request. + /// Throws when the template for the code cannot be found + /// Throws when the client does not have the permission. + /// Thrown when Discord is unable to process the request. public Task DeleteTemplateAsync(string code) => this.Discord.ApiClient.DeleteGuildTemplateAsync(this.Id, code); @@ -1894,7 +1894,7 @@ public Task DeleteTemplateAsync(string code) /// Gets this guild's membership screening form. /// /// This guild's membership screening form. - /// Thrown when Discord is unable to process the request. + /// Thrown when Discord is unable to process the request. public Task GetMembershipScreeningFormAsync() => this.Discord.ApiClient.GetGuildMembershipScreeningFormAsync(this.Id); @@ -1903,8 +1903,8 @@ public Task GetMembershipScreeningFormAsync() /// /// Action to perform /// The modified screening form. - /// Thrown when the client doesn't have the permission, or community is not enabled on this guild. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client doesn't have the permission, or community is not enabled on this guild. + /// Thrown when Discord is unable to process the request. public async Task ModifyMembershipScreeningFormAsync(Action action) { var mdl = new MembershipScreeningEditModel(); @@ -1952,7 +1952,7 @@ public async Task EditApplicationCommandAsync(ulong c /// Gets this guild's welcome screen. /// /// This guild's welcome screen object. - /// Thrown when Discord is unable to process the request. + /// Thrown when Discord is unable to process the request. public Task GetWelcomeScreenAsync() => this.Discord.ApiClient.GetGuildWelcomeScreenAsync(this.Id); @@ -1961,8 +1961,8 @@ public Task GetWelcomeScreenAsync() => /// /// Action to perform. /// The modified welcome screen. - /// Thrown when the client doesn't have the permission, or community is not enabled on this guild. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client doesn't have the permission, or community is not enabled on this guild. + /// Thrown when Discord is unable to process the request. public async Task ModifyWelcomeScreenAsync(Action action) { var mdl = new WelcomeScreenEditModel(); diff --git a/DisCatSharp/Entities/Guild/DiscordGuildEmoji.cs b/DisCatSharp/Entities/Guild/DiscordGuildEmoji.cs index cde2067106..1e50822e34 100644 --- a/DisCatSharp/Entities/Guild/DiscordGuildEmoji.cs +++ b/DisCatSharp/Entities/Guild/DiscordGuildEmoji.cs @@ -57,10 +57,10 @@ internal DiscordGuildEmoji() /// Roles for which this emoji will be available. This works only if your application is whitelisted as integration. /// Reason for audit log. /// The modified emoji. - /// Thrown when the client does not have the permission. - /// Thrown when the emoji does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the emoji does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task ModifyAsync(string name, IEnumerable roles = null, string reason = null) => this.Guild.ModifyEmojiAsync(this, name, roles, reason); @@ -68,10 +68,10 @@ public Task ModifyAsync(string name, IEnumerable /// Deletes this emoji. /// /// Reason for audit log. - /// Thrown when the client does not have the permission. - /// Thrown when the emoji does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the emoji does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task DeleteAsync(string reason = null) => this.Guild.DeleteEmojiAsync(this, reason); } diff --git a/DisCatSharp/Entities/Guild/DiscordMember.cs b/DisCatSharp/Entities/Guild/DiscordMember.cs index 0d20571d12..8166077d80 100644 --- a/DisCatSharp/Entities/Guild/DiscordMember.cs +++ b/DisCatSharp/Entities/Guild/DiscordMember.cs @@ -386,10 +386,10 @@ public override UserFlags? Flags /// Creates a direct message channel to this member. /// /// Direct message channel to this member. - /// Thrown when the member has the bot blocked, the member is no longer in the guild, or if the member has Allow DM from server members off. - /// Thrown when the member does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the member has the bot blocked, the member is no longer in the guild, or if the member has Allow DM from server members off. + /// Thrown when the member does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task CreateDmChannelAsync() => this.Discord.ApiClient.CreateDmAsync(this.Id); @@ -398,10 +398,10 @@ public Task CreateDmChannelAsync() /// /// Content of the message to send. /// The sent message. - /// Thrown when the member has the bot blocked, the member is no longer in the guild, or if the member has Allow DM from server members off. - /// Thrown when the member does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the member has the bot blocked, the member is no longer in the guild, or if the member has Allow DM from server members off. + /// Thrown when the member does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public async Task SendMessageAsync(string content) { if (this.IsBot && this.Discord.CurrentUser.IsBot) @@ -416,10 +416,10 @@ public async Task SendMessageAsync(string content) /// /// Embed to attach to the message. /// The sent message. - /// Thrown when the member has the bot blocked, the member is no longer in the guild, or if the member has Allow DM from server members off. - /// Thrown when the member does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the member has the bot blocked, the member is no longer in the guild, or if the member has Allow DM from server members off. + /// Thrown when the member does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public async Task SendMessageAsync(DiscordEmbed embed) { if (this.IsBot && this.Discord.CurrentUser.IsBot) @@ -435,10 +435,10 @@ public async Task SendMessageAsync(DiscordEmbed embed) /// Content of the message to send. /// Embed to attach to the message. /// The sent message. - /// Thrown when the member has the bot blocked, the member is no longer in the guild, or if the member has Allow DM from server members off. - /// Thrown when the member does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the member has the bot blocked, the member is no longer in the guild, or if the member has Allow DM from server members off. + /// Thrown when the member does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public async Task SendMessageAsync(string content, DiscordEmbed embed) { if (this.IsBot && this.Discord.CurrentUser.IsBot) @@ -453,10 +453,10 @@ public async Task SendMessageAsync(string content, DiscordEmbed /// /// Builder to with the message. /// The sent message. - /// Thrown when the member has the bot blocked, the member is no longer in the guild, or if the member has Allow DM from server members off. - /// Thrown when the member does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the member has the bot blocked, the member is no longer in the guild, or if the member has Allow DM from server members off. + /// Thrown when the member does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public async Task SendMessageAsync(DiscordMessageBuilder message) { if (this.IsBot && this.Discord.CurrentUser.IsBot) @@ -471,10 +471,10 @@ public async Task SendMessageAsync(DiscordMessageBuilder message /// /// Whether the member is to be muted. /// Reason for audit logs. - /// Thrown when the client does not have the permission. - /// Thrown when the member does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the member does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task SetMuteAsync(bool mute, string reason = null) => this.Discord.ApiClient.ModifyGuildMemberAsync(this.GuildId, this.Id, default, default, mute, default, default, reason); @@ -483,10 +483,10 @@ public Task SetMuteAsync(bool mute, string reason = null) /// /// Whether the member is to be deafened. /// Reason for audit logs. - /// Thrown when the client does not have the permission. - /// Thrown when the member does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the member does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task SetDeafAsync(bool deaf, string reason = null) => this.Discord.ApiClient.ModifyGuildMemberAsync(this.GuildId, this.Id, default, default, default, deaf, default, reason); @@ -494,10 +494,10 @@ public Task SetDeafAsync(bool deaf, string reason = null) /// Modifies this member. /// /// Action to perform on this member. - /// Thrown when the client does not have the permission. - /// Thrown when the member does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the member does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public async Task ModifyAsync(Action action) { var mdl = new MemberEditModel(); @@ -533,10 +533,10 @@ await this.Discord.ApiClient.ModifyGuildMemberAsync(this.Guild.Id, this.Id, mdl. /// /// The datetime offset to time out the user. Up to 28 days. /// Reason for audit logs. - /// Thrown when the client does not have the permission. - /// Thrown when the member does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the member does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task TimeoutAsync(DateTimeOffset until, string reason = null) => until.Subtract(DateTimeOffset.UtcNow).Days > 28 ? throw new ArgumentException("Timeout can not be longer than 28 days") : this.Discord.ApiClient.ModifyTimeoutAsync(this.Guild.Id, this.Id, until, reason); @@ -545,10 +545,10 @@ public Task TimeoutAsync(DateTimeOffset until, string reason = null) /// /// The timespan to time out the user. Up to 28 days. /// Reason for audit logs. - /// Thrown when the client does not have the permission. - /// Thrown when the member does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the member does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task TimeoutAsync(TimeSpan until, string reason = null) => this.TimeoutAsync(DateTimeOffset.UtcNow + until, reason); @@ -557,10 +557,10 @@ public Task TimeoutAsync(TimeSpan until, string reason = null) /// /// The datetime to time out the user. Up to 28 days. /// Reason for audit logs. - /// Thrown when the client does not have the permission. - /// Thrown when the member does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the member does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task TimeoutAsync(DateTime until, string reason = null) => this.TimeoutAsync(until.ToUniversalTime() - DateTime.UtcNow, reason); @@ -568,10 +568,10 @@ public Task TimeoutAsync(DateTime until, string reason = null) /// Removes the timeout from a member. /// /// Reason for audit logs. - /// Thrown when the client does not have the permission. - /// Thrown when the member does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the member does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task RemoveTimeoutAsync(string reason = null) => this.Discord.ApiClient.ModifyTimeoutAsync(this.Guild.Id, this.Id, null, reason); /// @@ -579,10 +579,10 @@ public Task TimeoutAsync(DateTime until, string reason = null) /// /// Role to grant. /// Reason for audit logs. - /// Thrown when the client does not have the permission. - /// Thrown when the member does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the member does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task GrantRoleAsync(DiscordRole role, string reason = null) => this.Discord.ApiClient.AddGuildMemberRoleAsync(this.Guild.Id, this.Id, role.Id, reason); @@ -591,10 +591,10 @@ public Task GrantRoleAsync(DiscordRole role, string reason = null) /// /// Role to revoke. /// Reason for audit logs. - /// Thrown when the client does not have the permission. - /// Thrown when the member does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the member does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task RevokeRoleAsync(DiscordRole role, string reason = null) => this.Discord.ApiClient.RemoveGuildMemberRoleAsync(this.Guild.Id, this.Id, role.Id, reason); @@ -603,10 +603,10 @@ public Task RevokeRoleAsync(DiscordRole role, string reason = null) /// /// Roles to set. /// Reason for audit logs. - /// Thrown when the client does not have the permission. - /// Thrown when the member does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the member does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task ReplaceRolesAsync(IEnumerable roles, string reason = null) => this.Discord.ApiClient.ModifyGuildMemberAsync(this.Guild.Id, this.Id, default, Optional.Some(roles.Select(xr => xr.Id)), default, default, default, reason); @@ -616,10 +616,10 @@ public Task ReplaceRolesAsync(IEnumerable roles, string reason = nu /// /// How many days to remove messages from. /// Reason for audit logs. - /// Thrown when the client does not have the permission. - /// Thrown when the member does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the member does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task BanAsync(int deleteMessageDays = 0, string reason = null) => this.Guild.BanMemberAsync(this, deleteMessageDays, reason); @@ -627,9 +627,9 @@ public Task BanAsync(int deleteMessageDays = 0, string reason = null) /// Unbans this member from their guild. /// /// Thrown when the client does not have the permission. - /// Thrown when the member does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the member does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task UnbanAsync(string reason = null) => this.Guild.UnbanMemberAsync(this, reason); /// @@ -637,10 +637,10 @@ public Task BanAsync(int deleteMessageDays = 0, string reason = null) /// /// Reason for audit logs. /// - /// Thrown when the client does not have the permission. - /// Thrown when the member does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the member does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task RemoveAsync(string reason = null) => this.Discord.ApiClient.RemoveGuildMemberAsync(this.GuildId, this.Id, reason); @@ -649,10 +649,10 @@ public Task RemoveAsync(string reason = null) /// /// - /// Thrown when the client does not have the permission. - /// Thrown when the member does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the member does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task PlaceInAsync(DiscordChannel channel) => channel.PlaceMemberAsync(this); @@ -661,7 +661,7 @@ public Task PlaceInAsync(DiscordChannel channel) /// /// The channel the member is currently in. /// Toggles the member's suppress state. - /// Thrown when the channel in not a voice channel. + /// Thrown when the channel in not a voice channel. public async Task UpdateVoiceStateAsync(DiscordChannel channel, bool? suppress) { if (channel.Type != ChannelType.Stage) @@ -673,11 +673,11 @@ public async Task UpdateVoiceStateAsync(DiscordChannel channel, bool? suppress) /// /// Makes the user a speaker. /// - /// Thrown when the user is not inside an stage channel. - /// Thrown when the client does not have the permission. - /// Thrown when the member does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the user is not inside an stage channel. + /// Thrown when the client does not have the permission. + /// Thrown when the member does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public async Task MakeSpeakerAsync() { var vs = this.VoiceState; @@ -690,11 +690,11 @@ public async Task MakeSpeakerAsync() /// /// Moves the user to audience. /// - /// Thrown when the user is not inside an stage channel. - /// Thrown when the client does not have the permission. - /// Thrown when the member does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the user is not inside an stage channel. + /// Thrown when the client does not have the permission. + /// Thrown when the member does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public async Task MoveToAudienceAsync() { var vs = this.VoiceState; diff --git a/DisCatSharp/Entities/Guild/DiscordRole.cs b/DisCatSharp/Entities/Guild/DiscordRole.cs index 5bd61dc35e..2ea0002146 100644 --- a/DisCatSharp/Entities/Guild/DiscordRole.cs +++ b/DisCatSharp/Entities/Guild/DiscordRole.cs @@ -139,10 +139,10 @@ public string Mention /// New position /// Reason why we moved it /// - /// Thrown when the client does not have the permission. - /// Thrown when the role does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the role does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task ModifyPositionAsync(int position, string reason = null) { var roles = this.Discord.Guilds[this.GuildId].Roles.Values.OrderByDescending(xr => xr.Position) @@ -166,10 +166,10 @@ public Task ModifyPositionAsync(int position, string reason = null) /// New role hoist. /// Whether this role is mentionable. /// Audit log reason. - /// Thrown when the client does not have the permission. - /// Thrown when the role does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the role does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task ModifyAsync(string name = null, Permissions? permissions = null, DiscordColor? color = null, bool? hoist = null, bool? mentionable = null, string reason = null) => this.Discord.ApiClient.ModifyGuildRoleAsync(this.GuildId, this.Id, name, permissions, color?.Value, hoist, mentionable, null, null, reason); @@ -178,9 +178,9 @@ public Task ModifyAsync(string name = null, Permissions? permissions = null, Dis /// /// The action. /// Thrown when the client does not have the permission. - /// Thrown when the role does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the role does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task ModifyAsync(Action action) { var mdl = new RoleEditModel(); @@ -214,10 +214,10 @@ public Task ModifyAsync(Action action) /// /// Reason as to why this role has been deleted. /// - /// Thrown when the client does not have the permission. - /// Thrown when the role does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the role does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task DeleteAsync(string reason = null) => this.Discord.ApiClient.DeleteRoleAsync(this.GuildId, this.Id, reason); diff --git a/DisCatSharp/Entities/Guild/ScheduledEvent/DiscordScheduledEvent.cs b/DisCatSharp/Entities/Guild/ScheduledEvent/DiscordScheduledEvent.cs index 11486017b7..c6d1bc259f 100644 --- a/DisCatSharp/Entities/Guild/ScheduledEvent/DiscordScheduledEvent.cs +++ b/DisCatSharp/Entities/Guild/ScheduledEvent/DiscordScheduledEvent.cs @@ -195,10 +195,10 @@ internal DiscordScheduledEvent() /// Modifies the current scheduled event. /// /// Action to perform on this thread - /// Thrown when the client does not have the permission. - /// Thrown when the event does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the event does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public async Task ModifyAsync(Action action) { var mdl = new ScheduledEventEditModel(); @@ -223,10 +223,10 @@ public async Task ModifyAsync(Action action) /// /// Starts the current scheduled event. /// - /// Thrown when the client does not have the permission. - /// Thrown when the event does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the event does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public async Task StartAsync(string reason = null) => this.Status == ScheduledEventStatus.Scheduled ? await this.Discord.ApiClient.ModifyGuildScheduledEventStatusAsync(this.GuildId, this.Id, ScheduledEventStatus.Active, reason) : throw new InvalidOperationException("You can only start scheduled events"); @@ -234,10 +234,10 @@ public async Task StartAsync(string reason = null) /// Cancels the current scheduled event. /// /// The audit log reason. - /// Thrown when the client does not have the permission. - /// Thrown when the event does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the event does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public async Task CancelAsync(string reason = null) => this.Status == ScheduledEventStatus.Scheduled ? await this.Discord.ApiClient.ModifyGuildScheduledEventStatusAsync(this.GuildId, this.Id, ScheduledEventStatus.Canceled, reason) : throw new InvalidOperationException("You can only cancel scheduled events"); @@ -245,10 +245,10 @@ public async Task CancelAsync(string reason = null) /// Ends the current scheduled event. /// /// The audit log reason. - /// Thrown when the client does not have the permission. - /// Thrown when the event does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the event does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public async Task EndAsync(string reason = null) => this.Status == ScheduledEventStatus.Active ? await this.Discord.ApiClient.ModifyGuildScheduledEventStatusAsync(this.GuildId, this.Id, ScheduledEventStatus.Completed, reason) : throw new InvalidOperationException("You can only stop active events"); @@ -259,10 +259,10 @@ public async Task EndAsync(string reason = null) /// Get results of before the given snowflake. /// Get results of after the given snowflake. /// Whether to include guild member data. - /// Thrown when the client does not have the correct permissions. - /// Thrown when the event does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the correct permissions. + /// Thrown when the event does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public async Task> GetUsersAsync(int? limit = null, ulong? before = null, ulong? after = null, bool? withMember = null) => await this.Discord.ApiClient.GetGuildScheduledEventRspvUsersAsync(this.GuildId, this.Id, limit, before, after, withMember); @@ -270,10 +270,10 @@ public async Task> GetUser /// Deletes a scheduled event. /// /// The audit log reason. - /// Thrown when the client does not have the permission. - /// Thrown when the event does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the event does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public async Task DeleteAsync(string reason = null) => await this.Discord.ApiClient.DeleteGuildScheduledEventAsync(this.GuildId, this.Id, reason); diff --git a/DisCatSharp/Entities/Interaction/DiscordFollowupMessageBuilder.cs b/DisCatSharp/Entities/Interaction/DiscordFollowupMessageBuilder.cs index f43e8a54c0..925b7e2fc4 100644 --- a/DisCatSharp/Entities/Interaction/DiscordFollowupMessageBuilder.cs +++ b/DisCatSharp/Entities/Interaction/DiscordFollowupMessageBuilder.cs @@ -93,7 +93,7 @@ public string Content /// /// The collection of components to add. /// The builder to chain calls with. - /// contained more than 5 components. + /// contained more than 5 components. public DiscordFollowupMessageBuilder AddComponents(params DiscordComponent[] components) => this.AddComponents((IEnumerable)components); @@ -120,7 +120,7 @@ public DiscordFollowupMessageBuilder AddComponents(IEnumerable /// The collection of components to add. /// The builder to chain calls with. - /// contained more than 5 components. + /// contained more than 5 components. public DiscordFollowupMessageBuilder AddComponents(IEnumerable components) { var compArr = components.ToArray(); diff --git a/DisCatSharp/Entities/Interaction/DiscordInteractionModalBuilder.cs b/DisCatSharp/Entities/Interaction/DiscordInteractionModalBuilder.cs index 9e5ca590d1..4e22635300 100644 --- a/DisCatSharp/Entities/Interaction/DiscordInteractionModalBuilder.cs +++ b/DisCatSharp/Entities/Interaction/DiscordInteractionModalBuilder.cs @@ -83,7 +83,7 @@ public DiscordInteractionModalBuilder WithCustomId(string customId) /// /// The components to append. Up to five. /// The current builder to chain calls with. - /// Thrown when passing more than 5 components. + /// Thrown when passing more than 5 components. public DiscordInteractionModalBuilder AddTextComponents(params DiscordTextComponent[] components) => this.AddModalComponents(components); @@ -92,7 +92,7 @@ public DiscordInteractionModalBuilder AddTextComponents(params DiscordTextCompon /// /// The components to append. Up to five. /// The current builder to chain calls with. - /// Thrown when passing more than 5 components. + /// Thrown when passing more than 5 components. public DiscordInteractionModalBuilder AddSelectComponents(params DiscordSelectComponent[] components) => this.AddModalComponents(components); @@ -117,7 +117,7 @@ public DiscordInteractionModalBuilder AddSelectComponent(DiscordSelectComponent /// /// The components to append. Up to five. /// The current builder to chain calls with. - /// Thrown when passing more than 5 components. + /// Thrown when passing more than 5 components. public DiscordInteractionModalBuilder AddModalComponents(params DiscordComponent[] components) { var ara = components.ToArray(); @@ -139,7 +139,7 @@ public DiscordInteractionModalBuilder AddModalComponents(params DiscordComponent /// /// The rows of components to add, holding up to five each. /// The current builder to chain calls with. - /// Thrown when passing more than 5 components. + /// Thrown when passing more than 5 components. public DiscordInteractionModalBuilder AddModalComponents(IEnumerable components) { var ara = components.ToArray(); diff --git a/DisCatSharp/Entities/Interaction/DiscordInteractionResponseBuilder.cs b/DisCatSharp/Entities/Interaction/DiscordInteractionResponseBuilder.cs index 23e377bcdc..ee8f4586b4 100644 --- a/DisCatSharp/Entities/Interaction/DiscordInteractionResponseBuilder.cs +++ b/DisCatSharp/Entities/Interaction/DiscordInteractionResponseBuilder.cs @@ -114,7 +114,7 @@ public DiscordInteractionResponseBuilder(DiscordMessageBuilder builder) /// /// The components to append. Up to five. /// The current builder to chain calls with. - /// Thrown when passing more than 5 components. + /// Thrown when passing more than 5 components. public DiscordInteractionResponseBuilder AddComponents(params DiscordComponent[] components) => this.AddComponents((IEnumerable)components); @@ -141,7 +141,7 @@ public DiscordInteractionResponseBuilder AddComponents(IEnumerable /// The components to append. Up to five. /// The current builder to chain calls with. - /// Thrown when passing more than 5 components. + /// Thrown when passing more than 5 components. public DiscordInteractionResponseBuilder AddComponents(IEnumerable components) { var compArr = components.ToArray(); diff --git a/DisCatSharp/Entities/Invite/DiscordInvite.cs b/DisCatSharp/Entities/Invite/DiscordInvite.cs index 5c10f33f3f..acc764fdaf 100644 --- a/DisCatSharp/Entities/Invite/DiscordInvite.cs +++ b/DisCatSharp/Entities/Invite/DiscordInvite.cs @@ -182,10 +182,10 @@ internal DiscordInvite() /// /// Reason for audit logs. /// - /// Thrown when the client does not have the permission or the permission. - /// Thrown when the emoji does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission or the permission. + /// Thrown when the emoji does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task DeleteAsync(string reason = null) => this.Discord.ApiClient.DeleteInviteAsync(this.Code, reason); diff --git a/DisCatSharp/Entities/Message/DiscordMessage.cs b/DisCatSharp/Entities/Message/DiscordMessage.cs index c500200ea1..1fbe6f3e0c 100644 --- a/DisCatSharp/Entities/Message/DiscordMessage.cs +++ b/DisCatSharp/Entities/Message/DiscordMessage.cs @@ -509,10 +509,10 @@ internal void PopulateMentions() /// Edits the message. /// /// New content. - /// Thrown when the client tried to modify a message not sent by them. - /// Thrown when the member does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client tried to modify a message not sent by them. + /// Thrown when the member does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task ModifyAsync(Optional content) => this.Discord.ApiClient.EditMessageAsync(this.ChannelId, this.Id, content, default, this.GetMentions(), default, default, Array.Empty(), default); @@ -520,10 +520,10 @@ public Task ModifyAsync(Optional content) /// Edits the message. /// /// New embed. - /// Thrown when the client tried to modify a message not sent by them. - /// Thrown when the member does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client tried to modify a message not sent by them. + /// Thrown when the member does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task ModifyAsync(Optional embed = default) => this.Discord.ApiClient.EditMessageAsync(this.ChannelId, this.Id, default, embed.Map(v => new[] { v }).ValueOr(Array.Empty()), this.GetMentions(), default, default, Array.Empty(), default); @@ -532,10 +532,10 @@ public Task ModifyAsync(Optional embed = default) /// /// New content. /// New embed. - /// Thrown when the client tried to modify a message not sent by them. - /// Thrown when the member does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client tried to modify a message not sent by them. + /// Thrown when the member does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task ModifyAsync(Optional content, Optional embed = default) => this.Discord.ApiClient.EditMessageAsync(this.ChannelId, this.Id, content, embed.Map(v => new[] { v }).ValueOr(Array.Empty()), this.GetMentions(), default, default, Array.Empty(), default); @@ -544,10 +544,10 @@ public Task ModifyAsync(Optional content, Optional /// New content. /// New embeds. - /// Thrown when the client tried to modify a message not sent by them. - /// Thrown when the member does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client tried to modify a message not sent by them. + /// Thrown when the member does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task ModifyAsync(Optional content, Optional> embeds = default) => this.Discord.ApiClient.EditMessageAsync(this.ChannelId, this.Id, content, embeds, this.GetMentions(), default, default, Array.Empty(), default); @@ -555,10 +555,10 @@ public Task ModifyAsync(Optional content, Optional /// The builder of the message to edit. - /// Thrown when the client tried to modify a message not sent by them. - /// Thrown when the member does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client tried to modify a message not sent by them. + /// Thrown when the member does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public async Task ModifyAsync(DiscordMessageBuilder builder) { builder.Validate(true); @@ -569,10 +569,10 @@ public async Task ModifyAsync(DiscordMessageBuilder builder) /// Edits the message embed suppression. /// /// Suppress embeds. - /// Thrown when the client tried to modify a message not sent by them. - /// Thrown when the member does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client tried to modify a message not sent by them. + /// Thrown when the member does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task ModifySuppressionAsync(bool suppress = false) => this.Discord.ApiClient.EditMessageAsync(this.ChannelId, this.Id, default, default, default, default, suppress, default, default); @@ -587,10 +587,10 @@ public Task ClearAttachmentsAsync() /// Edits the message. /// /// The builder of the message to edit. - /// Thrown when the client tried to modify a message not sent by them. - /// Thrown when the member does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client tried to modify a message not sent by them. + /// Thrown when the member does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public async Task ModifyAsync(Action action) { var builder = new DiscordMessageBuilder(); @@ -602,10 +602,10 @@ public async Task ModifyAsync(Action acti /// /// Deletes the message. /// - /// Thrown when the client does not have the permission. - /// Thrown when the member does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the member does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task DeleteAsync(string reason = null) => this.Discord.ApiClient.DeleteMessageAsync(this.ChannelId, this.Id, reason); @@ -617,11 +617,11 @@ public Task DeleteAsync(string reason = null) /// till it gets archived. Defaults to /// The per user ratelimit, aka slowdown. /// The reason. - /// Thrown when the client does not have the or permission. - /// Thrown when the channel does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. - /// Thrown when the cannot be modified. + /// Thrown when the client does not have the or permission. + /// Thrown when the channel does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. + /// Thrown when the cannot be modified. public async Task CreateThreadAsync(string name, ThreadAutoArchiveDuration autoArchiveDuration = ThreadAutoArchiveDuration.OneHour, int? rateLimitPerUser = null, string reason = null) => Utilities.CheckThreadAutoArchiveDurationFeature(this.Channel.Guild, autoArchiveDuration) ? await this.Discord.ApiClient.CreateThreadAsync(this.ChannelId, this.Id, name, autoArchiveDuration, this.Channel.Type == ChannelType.News ? ChannelType.NewsThread : ChannelType.PublicThread, rateLimitPerUser, isForum: false, reason: reason) @@ -630,20 +630,20 @@ public async Task CreateThreadAsync(string name, ThreadAut /// /// Pins the message in its channel. /// - /// Thrown when the client does not have the permission. - /// Thrown when the member does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the member does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task PinAsync() => this.Discord.ApiClient.PinMessageAsync(this.ChannelId, this.Id); /// /// Unpins the message in its channel. /// - /// Thrown when the client does not have the permission. - /// Thrown when the member does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the member does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task UnpinAsync() => this.Discord.ApiClient.UnpinMessageAsync(this.ChannelId, this.Id); @@ -652,10 +652,10 @@ public Task UnpinAsync() /// /// Message content to respond with. /// The sent message. - /// Thrown when the client does not have the permission. - /// Thrown when the member does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the member does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task RespondAsync(string content) => this.Discord.ApiClient.CreateMessageAsync(this.ChannelId, content, null, sticker: null, replyMessageId: this.Id, mentionReply: false, failOnInvalidReply: false); @@ -664,10 +664,10 @@ public Task RespondAsync(string content) /// /// Embed to attach to the message. /// The sent message. - /// Thrown when the client does not have the permission. - /// Thrown when the member does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the member does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task RespondAsync(DiscordEmbed embed) => this.Discord.ApiClient.CreateMessageAsync(this.ChannelId, null, embed != null ? new[] { embed } : null, sticker: null, replyMessageId: this.Id, mentionReply: false, failOnInvalidReply: false); @@ -677,10 +677,10 @@ public Task RespondAsync(DiscordEmbed embed) /// Message content to respond with. /// Embed to attach to the message. /// The sent message. - /// Thrown when the client does not have the permission. - /// Thrown when the member does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the member does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task RespondAsync(string content, DiscordEmbed embed) => this.Discord.ApiClient.CreateMessageAsync(this.ChannelId, content, embed != null ? new[] { embed } : null, sticker: null, replyMessageId: this.Id, mentionReply: false, failOnInvalidReply: false); @@ -689,10 +689,10 @@ public Task RespondAsync(string content, DiscordEmbed embed) /// /// The Discord message builder. /// The sent message. - /// Thrown when the client does not have the permission. - /// Thrown when the member does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the member does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task RespondAsync(DiscordMessageBuilder builder) => this.Discord.ApiClient.CreateMessageAsync(this.ChannelId, builder.WithReply(this.Id, mention: false, failOnInvalidReply: false)); @@ -701,10 +701,10 @@ public Task RespondAsync(DiscordMessageBuilder builder) /// /// The Discord message builder. /// The sent message. - /// Thrown when the client does not have the permission. - /// Thrown when the member does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the member does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task RespondAsync(Action action) { var builder = new DiscordMessageBuilder(); @@ -716,10 +716,10 @@ public Task RespondAsync(Action action) /// Creates a reaction to this message. /// /// The emoji you want to react with, either an emoji or name:id - /// Thrown when the client does not have the permission. - /// Thrown when the emoji does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the emoji does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task CreateReactionAsync(DiscordEmoji emoji) => this.Discord.ApiClient.CreateReactionAsync(this.ChannelId, this.Id, emoji.ToReactionString()); @@ -727,9 +727,9 @@ public Task CreateReactionAsync(DiscordEmoji emoji) /// Deletes your own reaction /// /// Emoji for the reaction you want to remove, either an emoji or name:id - /// Thrown when the emoji does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the emoji does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task DeleteOwnReactionAsync(DiscordEmoji emoji) => this.Discord.ApiClient.DeleteOwnReactionAsync(this.ChannelId, this.Id, emoji.ToReactionString()); @@ -739,10 +739,10 @@ public Task DeleteOwnReactionAsync(DiscordEmoji emoji) /// Emoji for the reaction you want to remove, either an emoji or name:id. /// Member you want to remove the reaction for /// Reason for audit logs. - /// Thrown when the client does not have the permission. - /// Thrown when the emoji does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the emoji does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task DeleteReactionAsync(DiscordEmoji emoji, DiscordUser user, string reason = null) => this.Discord.ApiClient.DeleteUserReactionAsync(this.ChannelId, this.Id, user.Id, emoji.ToReactionString(), reason); @@ -752,9 +752,9 @@ public Task DeleteReactionAsync(DiscordEmoji emoji, DiscordUser user, string rea /// Emoji to react with. /// Limit of users to fetch. /// Fetch users after this user's id. - /// Thrown when the emoji does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the emoji does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task> GetReactionsAsync(DiscordEmoji emoji, int limit = 25, ulong? after = null) => this.GetReactionsInternalAsync(emoji, limit, after); @@ -762,10 +762,10 @@ public Task> GetReactionsAsync(DiscordEmoji emoji, in /// Deletes all reactions for this message. /// /// Reason for audit logs. - /// Thrown when the client does not have the permission. - /// Thrown when the emoji does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the emoji does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task DeleteAllReactionsAsync(string reason = null) => this.Discord.ApiClient.DeleteAllReactionsAsync(this.ChannelId, this.Id, reason); @@ -773,10 +773,10 @@ public Task DeleteAllReactionsAsync(string reason = null) /// Deletes all reactions of a specific reaction for this message. /// /// The emoji to clear, either an emoji or name:id. - /// Thrown when the client does not have the permission. - /// Thrown when the emoji does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the emoji does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task DeleteReactionsEmojiAsync(DiscordEmoji emoji) => this.Discord.ApiClient.DeleteReactionsEmojiAsync(this.ChannelId, this.Id, emoji.ToReactionString()); diff --git a/DisCatSharp/Entities/Message/DiscordMessageBuilder.cs b/DisCatSharp/Entities/Message/DiscordMessageBuilder.cs index 92c396e510..8de34e8243 100644 --- a/DisCatSharp/Entities/Message/DiscordMessageBuilder.cs +++ b/DisCatSharp/Entities/Message/DiscordMessageBuilder.cs @@ -154,7 +154,7 @@ public DiscordMessageBuilder WithSticker(DiscordSticker sticker) /// /// The components to add to the message. /// The current builder to be chained. - /// No components were passed. + /// No components were passed. public DiscordMessageBuilder AddComponents(params DiscordComponent[] components) => this.AddComponents((IEnumerable)components); @@ -182,7 +182,7 @@ public DiscordMessageBuilder AddComponents(IEnumerable /// The components to add to the message. /// The current builder to be chained. - /// No components were passed. + /// No components were passed. public DiscordMessageBuilder AddComponents(IEnumerable components) { var cmpArr = components.ToArray(); diff --git a/DisCatSharp/Entities/Optional.cs b/DisCatSharp/Entities/Optional.cs index 3ec3522279..2809e2d8fb 100644 --- a/DisCatSharp/Entities/Optional.cs +++ b/DisCatSharp/Entities/Optional.cs @@ -56,7 +56,7 @@ public static Optional Some(T value) => value; /// - /// + /// /// /// /// @@ -131,7 +131,7 @@ internal interface IOptional /// /// Gets the value of this . /// - /// If this has no value. + /// If this has no value. public T Value => this.HasValue ? this._val : throw new InvalidOperationException("Value is not set."); /// diff --git a/DisCatSharp/Entities/Sticker/DiscordSticker.cs b/DisCatSharp/Entities/Sticker/DiscordSticker.cs index a01fae220b..6fe2dab97f 100644 --- a/DisCatSharp/Entities/Sticker/DiscordSticker.cs +++ b/DisCatSharp/Entities/Sticker/DiscordSticker.cs @@ -168,10 +168,10 @@ public bool Equals(DiscordSticker other) /// The name of a unicode emoji representing the sticker's expression /// Audit log reason /// A sticker object - /// Thrown when the sticker could not be found. - /// Thrown when the client does not have the permission. - /// Thrown when Discord is unable to process the request. - /// Sticker does not belong to a guild. + /// Thrown when the sticker could not be found. + /// Thrown when the client does not have the permission. + /// Thrown when Discord is unable to process the request. + /// Sticker does not belong to a guild. public Task ModifyAsync(Optional name, Optional description, Optional tags, string reason = null) => !this.GuildId.HasValue ? throw new ArgumentException("This sticker does not belong to a guild.") @@ -187,10 +187,10 @@ public Task ModifyAsync(Optional name, Optional /// Deletes the sticker /// /// Audit log reason - /// Thrown when the sticker could not be found. - /// Thrown when the client does not have the permission. - /// Thrown when Discord is unable to process the request. - /// Sticker does not belong to a guild. + /// Thrown when the sticker could not be found. + /// Thrown when the client does not have the permission. + /// Thrown when Discord is unable to process the request. + /// Sticker does not belong to a guild. public Task DeleteAsync(string reason = null) => this.GuildId.HasValue ? this.Discord.ApiClient.DeleteGuildStickerAsync(this.GuildId.Value, this.Id, reason) : throw new ArgumentException("The requested sticker is no guild sticker."); } diff --git a/DisCatSharp/Entities/ThreadAndForum/DiscordThreadChannel.cs b/DisCatSharp/Entities/ThreadAndForum/DiscordThreadChannel.cs index df09831fb3..04267d2211 100644 --- a/DisCatSharp/Entities/ThreadAndForum/DiscordThreadChannel.cs +++ b/DisCatSharp/Entities/ThreadAndForum/DiscordThreadChannel.cs @@ -117,11 +117,11 @@ internal DiscordThreadChannel() /// Modifies the current thread. /// /// Action to perform on this thread - /// Thrown when the client does not have the permission. - /// Thrown when the thread does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. - /// Thrown when the cannot be modified. This happens, when the guild hasn't reached a certain boost . + /// Thrown when the client does not have the permission. + /// Thrown when the thread does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. + /// Thrown when the cannot be modified. This happens, when the guild hasn't reached a certain boost . public Task ModifyAsync(Action action) { var mdl = new ThreadEditModel(); @@ -140,10 +140,10 @@ public Task ModifyAsync(Action action) /// /// The tag to add. /// The reason for the audit logs. - /// Thrown when the client does not have the permission. - /// Thrown when the thread does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the thread does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public async Task AddTagAsync(ForumPostTag tag, string reason = null) => await this.Discord.ApiClient.ModifyThreadAsync(this.Id, this.Parent.Type, null, null, null, null, null, null, new List(this.AppliedTags) { tag }, reason: reason); @@ -152,10 +152,10 @@ public async Task AddTagAsync(ForumPostTag tag, string reason = null) /// /// The tag to remove. /// The reason for the audit logs. - /// Thrown when the client does not have the permission. - /// Thrown when the thread does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the thread does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public async Task RemoveTagAsync(ForumPostTag tag, string reason = null) => await this.Discord.ApiClient.ModifyThreadAsync(this.Id, this.Parent.Type, null, null, null, null, null, null, new List(this.AppliedTags).Where(x => x != tag).ToList(), reason: reason); @@ -164,10 +164,10 @@ public async Task RemoveTagAsync(ForumPostTag tag, string reason = null) /// /// Whether the thread should be locked. /// Reason for audit logs. - /// Thrown when the client does not have the permission. - /// Thrown when the thread does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the thread does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task ArchiveAsync(bool locked = true, string reason = null) => this.Discord.ApiClient.ModifyThreadAsync(this.Id, this.Parent.Type, null, locked, true, null, null, null, null, reason: reason); @@ -175,18 +175,18 @@ public Task ArchiveAsync(bool locked = true, string reason = null) /// Unarchives a thread. /// /// Reason for audit logs. - /// Thrown when the thread does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the thread does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task UnarchiveAsync(string reason = null) => this.Discord.ApiClient.ModifyThreadAsync(this.Id, this.Parent.Type, null, null, false, null, null, null, null, reason: reason); /// /// Gets the members of a thread. Needs the intent. /// - /// Thrown when the thread does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the thread does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public async Task> GetMembersAsync() => await this.Discord.ApiClient.GetThreadMembersAsync(this.Id); @@ -194,9 +194,9 @@ public async Task> GetMembersAsync() /// Adds a member to this thread. /// /// The member id to be added. - /// Thrown when the thread does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the thread does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task AddMemberAsync(ulong memberId) => this.Discord.ApiClient.AddThreadMemberAsync(this.Id, memberId); @@ -204,9 +204,9 @@ public Task AddMemberAsync(ulong memberId) /// Adds a member to this thread. /// /// The member to be added. - /// Thrown when the thread does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the thread does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task AddMemberAsync(DiscordMember member) => this.AddMemberAsync(member.Id); @@ -214,9 +214,9 @@ public Task AddMemberAsync(DiscordMember member) /// Gets a member in this thread. /// /// The member to be added. - /// Thrown when the member is not part of the thread. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the member is not part of the thread. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task GetMemberAsync(ulong memberId) => this.Discord.ApiClient.GetThreadMemberAsync(this.Id, memberId); @@ -224,9 +224,9 @@ public Task GetMemberAsync(ulong memberId) /// Gets a member in this thread. /// /// The member to be added. - /// Thrown when the member is not part of the thread. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the member is not part of the thread. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task GetMemberAsync(DiscordMember member) => this.Discord.ApiClient.GetThreadMemberAsync(this.Id, member.Id); @@ -234,9 +234,9 @@ public Task GetMemberAsync(DiscordMember member) /// Removes a member from this thread. /// /// The member id to be removed. - /// Thrown when the thread does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the thread does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task RemoveMemberAsync(ulong memberId) => this.Discord.ApiClient.RemoveThreadMemberAsync(this.Id, memberId); @@ -244,9 +244,9 @@ public Task RemoveMemberAsync(ulong memberId) /// Removes a member from this thread. Only applicable to private threads. /// /// The member to be removed. - /// Thrown when the thread does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the thread does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task RemoveMemberAsync(DiscordMember member) => this.RemoveMemberAsync(member.Id); @@ -254,9 +254,9 @@ public Task RemoveMemberAsync(DiscordMember member) /// Adds a role to this thread. Only applicable to private threads. /// /// The role id to be added. - /// Thrown when the thread does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the thread does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public async Task AddRoleAsync(ulong roleId) { var role = this.Guild.GetRole(roleId); @@ -272,9 +272,9 @@ public async Task AddRoleAsync(ulong roleId) /// Adds a role to this thread. Only applicable to private threads. /// /// The role to be added. - /// Thrown when the thread does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the thread does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task AddRoleAsync(DiscordRole role) => this.AddRoleAsync(role.Id); @@ -282,9 +282,9 @@ public Task AddRoleAsync(DiscordRole role) /// Removes a role from this thread. Only applicable to private threads. /// /// The role id to be removed. - /// Thrown when the thread does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the thread does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public async Task RemoveRoleAsync(ulong roleId) { var role = this.Guild.GetRole(roleId); @@ -300,29 +300,29 @@ public async Task RemoveRoleAsync(ulong roleId) /// Removes a role from this thread. Only applicable to private threads. /// /// The role to be removed. - /// Thrown when the thread does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the thread does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task RemoveRoleAsync(DiscordRole role) => this.RemoveRoleAsync(role.Id); /// /// Joins a thread. /// - /// Thrown when the client has no access to this thread. - /// Thrown when the thread does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client has no access to this thread. + /// Thrown when the thread does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task JoinAsync() => this.Discord.ApiClient.JoinThreadAsync(this.Id); /// /// Leaves a thread. /// - /// Thrown when the client has no access to this thread. - /// Thrown when the thread does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client has no access to this thread. + /// Thrown when the thread does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task LeaveAsync() => this.Discord.ApiClient.LeaveThreadAsync(this.Id); diff --git a/DisCatSharp/Entities/User/DiscordUser.cs b/DisCatSharp/Entities/User/DiscordUser.cs index 3fe53f5583..016ce164eb 100644 --- a/DisCatSharp/Entities/User/DiscordUser.cs +++ b/DisCatSharp/Entities/User/DiscordUser.cs @@ -357,9 +357,9 @@ public async Task IsNotInGuild(DiscordGuild guild) /// /// The to get this user on. /// The . - /// Thrown when the user is not part of the guild. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the user is not part of the guild. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public async Task ConvertToMember(DiscordGuild guild) => await guild.GetMemberAsync(this.Id); @@ -368,10 +368,10 @@ public async Task ConvertToMember(DiscordGuild guild) /// /// Guild to unban this user from. /// Reason for audit logs. - /// Thrown when the client does not have the permission. - /// Thrown when the user does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the user does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task UnbanAsync(DiscordGuild guild, string reason = null) => guild.UnbanMemberAsync(this, reason); diff --git a/DisCatSharp/Entities/Webhook/DiscordWebhook.cs b/DisCatSharp/Entities/Webhook/DiscordWebhook.cs index 90094ebbb9..0852aade44 100644 --- a/DisCatSharp/Entities/Webhook/DiscordWebhook.cs +++ b/DisCatSharp/Entities/Webhook/DiscordWebhook.cs @@ -115,10 +115,10 @@ internal DiscordWebhook() /// The new channel id to move the webhook to. /// Reason for audit logs. /// The modified webhook. - /// Thrown when the client does not have the permission. - /// Thrown when the webhook does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the webhook does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task ModifyAsync(string name = null, Optional avatar = default, ulong? channelId = null, string reason = null) { var avatarb64 = ImageTool.Base64FromStream(avatar); @@ -131,28 +131,28 @@ public Task ModifyAsync(string name = null, Optional ava /// /// Gets a previously-sent webhook message. /// - /// Thrown when the webhook does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the webhook does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public async Task GetMessageAsync(ulong messageId) => await (this.Discord?.ApiClient ?? this.ApiClient).GetWebhookMessageAsync(this.Id, this.Token, messageId).ConfigureAwait(false); /// /// Gets a previously-sent webhook message. /// - /// Thrown when the webhook does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the webhook does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public async Task GetMessageAsync(ulong messageId, ulong threadId) => await (this.Discord?.ApiClient ?? this.ApiClient).GetWebhookMessageAsync(this.Id, this.Token, messageId, threadId).ConfigureAwait(false); /// /// Permanently deletes this webhook. /// - /// Thrown when the client does not have the permission. - /// Thrown when the webhook does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the client does not have the permission. + /// Thrown when the webhook does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task DeleteAsync() => this.Discord.ApiClient.DeleteWebhookAsync(this.Id, this.Token); @@ -161,9 +161,9 @@ public Task DeleteAsync() /// /// Webhook builder filled with data to send. /// Target thread id (Optional). Defaults to null. - /// Thrown when the webhook does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the webhook does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task ExecuteAsync(DiscordWebhookBuilder builder, string threadId = null) => (this.Discord?.ApiClient ?? this.ApiClient).ExecuteWebhookAsync(this.Id, this.Token, builder, threadId); @@ -172,9 +172,9 @@ public Task ExecuteAsync(DiscordWebhookBuilder builder, string t /// /// JSON containing Slack-compatible payload for this webhook. /// Target thread id (Optional). Defaults to null. - /// Thrown when the webhook does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the webhook does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task ExecuteSlackAsync(string json, string threadId = null) => (this.Discord?.ApiClient ?? this.ApiClient).ExecuteWebhookSlackAsync(this.Id, this.Token, json, threadId); @@ -183,9 +183,9 @@ public Task ExecuteSlackAsync(string json, string threadId = null) /// /// JSON containing GitHub-compatible payload for this webhook. /// Target thread id (Optional). Defaults to null. - /// Thrown when the webhook does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the webhook does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task ExecuteGithubAsync(string json, string threadId = null) => (this.Discord?.ApiClient ?? this.ApiClient).ExecuteWebhookGithubAsync(this.Id, this.Token, json, threadId); @@ -196,9 +196,9 @@ public Task ExecuteGithubAsync(string json, string threadId = null) /// The builder of the message to edit. /// Target thread id (Optional). Defaults to null. /// The modified - /// Thrown when the webhook does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the webhook does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public async Task EditMessageAsync(ulong messageId, DiscordWebhookBuilder builder, string threadId = null) { builder.Validate(true); @@ -217,9 +217,9 @@ public async Task EditMessageAsync(ulong messageId, DiscordWebho /// Deletes a message that was created by the webhook. /// /// The id of the message to delete - /// Thrown when the webhook does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the webhook does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task DeleteMessageAsync(ulong messageId) => (this.Discord?.ApiClient ?? this.ApiClient).DeleteWebhookMessageAsync(this.Id, this.Token, messageId); @@ -228,9 +228,9 @@ public Task DeleteMessageAsync(ulong messageId) /// /// The id of the message to delete /// Target thread id (Optional). Defaults to null. - /// Thrown when the webhook does not exist. - /// Thrown when an invalid parameter was provided. - /// Thrown when Discord is unable to process the request. + /// Thrown when the webhook does not exist. + /// Thrown when an invalid parameter was provided. + /// Thrown when Discord is unable to process the request. public Task DeleteMessageAsync(ulong messageId, ulong threadId) => (this.Discord?.ApiClient ?? this.ApiClient).DeleteWebhookMessageAsync(this.Id, this.Token, messageId, threadId); diff --git a/DisCatSharp/Entities/Webhook/DiscordWebhookBuilder.cs b/DisCatSharp/Entities/Webhook/DiscordWebhookBuilder.cs index c1d1107028..fe6d548ff8 100644 --- a/DisCatSharp/Entities/Webhook/DiscordWebhookBuilder.cs +++ b/DisCatSharp/Entities/Webhook/DiscordWebhookBuilder.cs @@ -119,7 +119,7 @@ public DiscordWebhookBuilder() { } // I still see no point in initializing colle /// /// The components to add to the builder. /// The current builder to be chained. - /// No components were passed. + /// No components were passed. public DiscordWebhookBuilder AddComponents(params DiscordComponent[] components) => this.AddComponents((IEnumerable)components); @@ -147,7 +147,7 @@ public DiscordWebhookBuilder AddComponents(IEnumerable /// The components to add to the builder. /// The current builder to be chained. - /// No components were passed. + /// No components were passed. public DiscordWebhookBuilder AddComponents(IEnumerable components) { var cmpArr = components.ToArray(); diff --git a/DisCatSharp/Exceptions/BadRequestException.cs b/DisCatSharp/Exceptions/BadRequestException.cs index 4908428946..b2420d5de0 100644 --- a/DisCatSharp/Exceptions/BadRequestException.cs +++ b/DisCatSharp/Exceptions/BadRequestException.cs @@ -59,7 +59,7 @@ public class BadRequestException : Exception public string Errors { get; internal set; } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The request. /// The response. diff --git a/DisCatSharp/Exceptions/NotFoundException.cs b/DisCatSharp/Exceptions/NotFoundException.cs index 76bb50d24b..55232657b0 100644 --- a/DisCatSharp/Exceptions/NotFoundException.cs +++ b/DisCatSharp/Exceptions/NotFoundException.cs @@ -49,7 +49,7 @@ public class NotFoundException : Exception public string JsonMessage { get; internal set; } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The request. /// The response. diff --git a/DisCatSharp/Exceptions/ServerErrorException.cs b/DisCatSharp/Exceptions/ServerErrorException.cs index 837c1c1e56..f9cf0be552 100644 --- a/DisCatSharp/Exceptions/ServerErrorException.cs +++ b/DisCatSharp/Exceptions/ServerErrorException.cs @@ -49,7 +49,7 @@ public class ServerErrorException : Exception public string JsonMessage { get; internal set; } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The request. /// The response. diff --git a/DisCatSharp/Exceptions/UnauthorizedException.cs b/DisCatSharp/Exceptions/UnauthorizedException.cs index aaad0898c0..95bc91608a 100644 --- a/DisCatSharp/Exceptions/UnauthorizedException.cs +++ b/DisCatSharp/Exceptions/UnauthorizedException.cs @@ -49,7 +49,7 @@ public class UnauthorizedException : Exception public string JsonMessage { get; internal set; } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The request. /// The response. diff --git a/DisCatSharp/RingBuffer.cs b/DisCatSharp/RingBuffer.cs index 0e7d74b987..fd0f7addfb 100644 --- a/DisCatSharp/RingBuffer.cs +++ b/DisCatSharp/RingBuffer.cs @@ -67,7 +67,7 @@ public bool IsReadOnly /// Creates a new ring buffer with specified size. /// /// Size of the buffer to create. - /// + /// public RingBuffer(int size) { if (size <= 0) @@ -82,8 +82,8 @@ public RingBuffer(int size) /// Creates a new ring buffer, filled with specified elements. /// /// Elements to fill the buffer with. - /// - /// + /// + /// public RingBuffer(IEnumerable elements) : this(elements, 0) { } @@ -93,8 +93,8 @@ public RingBuffer(IEnumerable elements) /// /// Elements to fill the buffer with. /// Starting element index. - /// - /// + /// + /// public RingBuffer(IEnumerable elements, int index) { if (elements == null || !elements.Any()) @@ -166,7 +166,7 @@ public void Clear() /// /// Item to check for. /// Whether the buffer contains the item. - /// + /// public bool Contains(T item) => throw new NotImplementedException("This method is not implemented. Use .Contains(predicate) instead."); /// diff --git a/DisCatSharp/Utilities.cs b/DisCatSharp/Utilities.cs index 566a79c00b..c6324ec16c 100644 --- a/DisCatSharp/Utilities.cs +++ b/DisCatSharp/Utilities.cs @@ -345,11 +345,11 @@ public static int GetShardId(ulong guildId, int shardCount) => (int)(guildId >> 22) % shardCount; /// - /// Helper method to create a from Unix time seconds for targets that do not support this natively. + /// Helper method to create a from Unix time seconds for targets that do not support this natively. /// /// Unix time seconds to convert. /// Whether the method should throw on failure. Defaults to true. - /// Calculated . + /// Calculated . public static DateTimeOffset GetDateTimeOffset(long unixTime, bool shouldThrow = true) { try @@ -366,11 +366,11 @@ public static DateTimeOffset GetDateTimeOffset(long unixTime, bool shouldThrow = } /// - /// Helper method to create a from Unix time milliseconds for targets that do not support this natively. + /// Helper method to create a from Unix time milliseconds for targets that do not support this natively. /// /// Unix time milliseconds to convert. /// Whether the method should throw on failure. Defaults to true. - /// Calculated . + /// Calculated . public static DateTimeOffset GetDateTimeOffsetFromMilliseconds(long unixTime, bool shouldThrow = true) { try @@ -387,9 +387,9 @@ public static DateTimeOffset GetDateTimeOffsetFromMilliseconds(long unixTime, bo } /// - /// Helper method to calculate Unix time seconds from a for targets that do not support this natively. + /// Helper method to calculate Unix time seconds from a for targets that do not support this natively. /// - /// to calculate Unix time for. + /// to calculate Unix time for. /// Calculated Unix time. public static long GetUnixTime(DateTimeOffset dto) => dto.ToUnixTimeMilliseconds();