feature: Add DefaultArchiveDuration to ITextChannel (#2295)

This commit is contained in:
Armano den Boef
2022-05-18 09:51:37 +02:00
committed by GitHub
parent 13ccc7c997
commit 1f01881beb
5 changed files with 31 additions and 2 deletions

View File

@@ -21,11 +21,12 @@ namespace Discord.Rest
public virtual int SlowModeInterval { get; private set; }
/// <inheritdoc />
public ulong? CategoryId { get; private set; }
/// <inheritdoc />
public string Mention => MentionUtils.MentionChannel(Id);
/// <inheritdoc />
public bool IsNsfw { get; private set; }
/// <inheritdoc />
public ThreadArchiveDuration DefaultArchiveDuration { get; private set; }
internal RestTextChannel(BaseDiscordClient discord, IGuild guild, ulong id)
: base(discord, guild, id)
@@ -46,6 +47,12 @@ namespace Discord.Rest
if (model.SlowMode.IsSpecified)
SlowModeInterval = model.SlowMode.Value;
IsNsfw = model.Nsfw.GetValueOrDefault();
if (model.AutoArchiveDuration.IsSpecified)
DefaultArchiveDuration = model.AutoArchiveDuration.Value;
else
DefaultArchiveDuration = ThreadArchiveDuration.OneDay;
// basic value at channel creation. Shouldn't be called since guild text channels always have this property
}
/// <inheritdoc />