@@ -21,6 +21,17 @@ namespace Discord | |||||
/// </returns> | /// </returns> | ||||
int Position { get; } | int Position { get; } | ||||
/// <summary> | |||||
/// Gets the flags related to this channel. | |||||
/// </summary> | |||||
/// <remarks> | |||||
/// This value is determined by bitwise OR-ing <see cref="ChannelFlags"/> values together. | |||||
/// </remarks> | |||||
/// <returns> | |||||
/// A channel's flags, if any is associated. | |||||
/// </returns> | |||||
ChannelFlags Flags { get; } | |||||
/// <summary> | /// <summary> | ||||
/// Gets the guild associated with this channel. | /// Gets the guild associated with this channel. | ||||
/// </summary> | /// </summary> | ||||
@@ -79,5 +79,8 @@ namespace Discord.API | |||||
[JsonProperty("default_thread_rate_limit_per_user")] | [JsonProperty("default_thread_rate_limit_per_user")] | ||||
public Optional<int> ThreadRateLimitPerUser { get; set; } | public Optional<int> ThreadRateLimitPerUser { get; set; } | ||||
[JsonProperty("flags")] | |||||
public Optional<ChannelFlags> Flags { get; set; } | |||||
} | } | ||||
} | } |
@@ -26,6 +26,9 @@ namespace Discord.Rest | |||||
/// <inheritdoc /> | /// <inheritdoc /> | ||||
public ulong GuildId => Guild.Id; | public ulong GuildId => Guild.Id; | ||||
/// <inheritdoc /> | |||||
public ChannelFlags Flags { get; private set; } | |||||
internal RestGuildChannel(BaseDiscordClient discord, IGuild guild, ulong id) | internal RestGuildChannel(BaseDiscordClient discord, IGuild guild, ulong id) | ||||
: base(discord, id) | : base(discord, id) | ||||
{ | { | ||||
@@ -62,6 +65,8 @@ namespace Discord.Rest | |||||
newOverwrites.Add(overwrites[i].ToEntity()); | newOverwrites.Add(overwrites[i].ToEntity()); | ||||
_overwrites = newOverwrites.ToImmutable(); | _overwrites = newOverwrites.ToImmutable(); | ||||
} | } | ||||
Flags = model.Flags.GetValueOrDefault(ChannelFlags.None); | |||||
} | } | ||||
/// <inheritdoc /> | /// <inheritdoc /> | ||||
@@ -30,6 +30,9 @@ namespace Discord.WebSocket | |||||
/// <inheritdoc /> | /// <inheritdoc /> | ||||
public int Position { get; private set; } | public int Position { get; private set; } | ||||
/// <inheritdoc /> | |||||
public ChannelFlags Flags { get; private set; } | |||||
/// <inheritdoc /> | /// <inheritdoc /> | ||||
public virtual IReadOnlyCollection<Overwrite> PermissionOverwrites => _overwrites; | public virtual IReadOnlyCollection<Overwrite> PermissionOverwrites => _overwrites; | ||||
/// <summary> | /// <summary> | ||||
@@ -74,6 +77,8 @@ namespace Discord.WebSocket | |||||
for (int i = 0; i < overwrites.Length; i++) | for (int i = 0; i < overwrites.Length; i++) | ||||
newOverwrites.Add(overwrites[i].ToEntity()); | newOverwrites.Add(overwrites[i].ToEntity()); | ||||
_overwrites = newOverwrites.ToImmutable(); | _overwrites = newOverwrites.ToImmutable(); | ||||
Flags = model.Flags.GetValueOrDefault(ChannelFlags.None); | |||||
} | } | ||||
/// <inheritdoc /> | /// <inheritdoc /> | ||||
@@ -20,6 +20,8 @@ namespace Discord | |||||
public DateTimeOffset CreatedAt => throw new NotImplementedException(); | public DateTimeOffset CreatedAt => throw new NotImplementedException(); | ||||
public ulong Id => throw new NotImplementedException(); | public ulong Id => throw new NotImplementedException(); | ||||
public ChannelFlags Flags => throw new NotImplementedException(); | |||||
public Task AddPermissionOverwriteAsync(IRole role, OverwritePermissions permissions, RequestOptions options = null) | public Task AddPermissionOverwriteAsync(IRole role, OverwritePermissions permissions, RequestOptions options = null) | ||||
{ | { | ||||
@@ -34,6 +34,8 @@ namespace Discord | |||||
public ulong Id => throw new NotImplementedException(); | public ulong Id => throw new NotImplementedException(); | ||||
public ChannelFlags Flags => throw new NotImplementedException(); | |||||
public Task AddPermissionOverwriteAsync(IRole role, OverwritePermissions permissions, RequestOptions options = null) | public Task AddPermissionOverwriteAsync(IRole role, OverwritePermissions permissions, RequestOptions options = null) | ||||
{ | { | ||||
throw new NotImplementedException(); | throw new NotImplementedException(); | ||||
@@ -36,6 +36,8 @@ namespace Discord | |||||
public string Mention => throw new NotImplementedException(); | public string Mention => throw new NotImplementedException(); | ||||
public ChannelFlags Flags => throw new NotImplementedException(); | |||||
public Task AddPermissionOverwriteAsync(IRole role, OverwritePermissions permissions, RequestOptions options = null) => throw new NotImplementedException(); | public Task AddPermissionOverwriteAsync(IRole role, OverwritePermissions permissions, RequestOptions options = null) => throw new NotImplementedException(); | ||||
public Task AddPermissionOverwriteAsync(IUser user, OverwritePermissions permissions, RequestOptions options = null) => throw new NotImplementedException(); | public Task AddPermissionOverwriteAsync(IUser user, OverwritePermissions permissions, RequestOptions options = null) => throw new NotImplementedException(); | ||||
public Task<IAudioClient> ConnectAsync(bool selfDeaf = false, bool selfMute = false, bool external = false) => throw new NotImplementedException(); | public Task<IAudioClient> ConnectAsync(bool selfDeaf = false, bool selfMute = false, bool external = false) => throw new NotImplementedException(); | ||||