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:
@@ -45,7 +45,8 @@ namespace Discord.Rest
|
||||
Position = args.Position,
|
||||
CategoryId = args.CategoryId,
|
||||
Topic = args.Topic,
|
||||
IsNsfw = args.IsNsfw
|
||||
IsNsfw = args.IsNsfw,
|
||||
SlowMode = args.SlowMode,
|
||||
};
|
||||
return await client.ApiClient.ModifyGuildChannelAsync(channel.Id, apiArgs, options).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ namespace Discord.Rest
|
||||
public class RestTextChannel : RestGuildChannel, IRestMessageChannel, ITextChannel
|
||||
{
|
||||
public string Topic { get; private set; }
|
||||
public int SlowMode { get; private set; }
|
||||
public ulong? CategoryId { get; private set; }
|
||||
|
||||
public string Mention => MentionUtils.MentionChannel(Id);
|
||||
@@ -34,6 +35,7 @@ namespace Discord.Rest
|
||||
base.Update(model);
|
||||
CategoryId = model.CategoryId;
|
||||
Topic = model.Topic.Value;
|
||||
SlowMode = model.SlowMode.Value;
|
||||
_nsfw = model.Nsfw.GetValueOrDefault();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user