api: add slow mode
This adds the following property to ITextChannel - SlowMode (int) The SlowMode field defines the time in seconds users must wait between sending messages; if zero, slow-mode is disabled. Bots are not affected by slow-mode, and as such, no changes need to be made to the REST client's internal ratelimiting. This is strictly a read/write cosmetic property for bots.
This commit is contained in:
@@ -13,6 +13,9 @@ namespace Discord
|
||||
/// <summary> Gets the current topic for this text channel. </summary>
|
||||
string Topic { get; }
|
||||
|
||||
///<summary> Gets the current slow-mode delay for this channel. 0 if disabled. </summary>
|
||||
int SlowMode { get; }
|
||||
|
||||
/// <summary> Bulk deletes multiple messages. </summary>
|
||||
Task DeleteMessagesAsync(IEnumerable<IMessage> messages, RequestOptions options = null);
|
||||
/// <summary> Bulk deletes multiple messages. </summary>
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
namespace Discord
|
||||
using System;
|
||||
|
||||
namespace Discord
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public class TextChannelProperties : GuildChannelProperties
|
||||
@@ -11,5 +13,15 @@
|
||||
/// Should this channel be flagged as NSFW?
|
||||
/// </summary>
|
||||
public Optional<bool> IsNsfw { get; set; }
|
||||
/// <summary>
|
||||
/// What the slow-mode ratelimit for this channel should be set to; 0 will disable slow-mode.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This value must fall within [0, 120]
|
||||
///
|
||||
/// Users with <see cref="ChannelPermission.ManageMessages"/> will be exempt from slow-mode.
|
||||
/// </remarks>
|
||||
/// <exception cref="ArgumentOutOfRangeException">Throws ArgummentOutOfRange if the value does not fall within [0, 120]</exception>
|
||||
public Optional<int> SlowMode { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user