Removed IChannel#Nsfw, added to ITextChannel
This commit is contained in:
@@ -46,7 +46,6 @@ namespace Discord.Rest
|
||||
|
||||
//IChannel
|
||||
string IChannel.Name => null;
|
||||
bool IChannel.IsNsfw => false;
|
||||
|
||||
Task<IUser> IChannel.GetUserAsync(ulong id, CacheMode mode, RequestOptions options)
|
||||
=> Task.FromResult<IUser>(null); //Overriden
|
||||
|
||||
@@ -15,7 +15,8 @@ namespace Discord.Rest
|
||||
|
||||
public string Mention => MentionUtils.MentionChannel(Id);
|
||||
|
||||
internal bool Nsfw { get; private set; }
|
||||
private bool _nsfw;
|
||||
public bool IsNsfw => _nsfw || ChannelHelper.IsNsfw(this);
|
||||
|
||||
internal RestTextChannel(BaseDiscordClient discord, IGuild guild, ulong id)
|
||||
: base(discord, guild, id)
|
||||
@@ -32,7 +33,7 @@ namespace Discord.Rest
|
||||
base.Update(model);
|
||||
|
||||
Topic = model.Topic.Value;
|
||||
Nsfw = model.Nsfw.GetValueOrDefault();
|
||||
_nsfw = model.Nsfw.GetValueOrDefault();
|
||||
}
|
||||
|
||||
public async Task ModifyAsync(Action<TextChannelProperties> func, RequestOptions options = null)
|
||||
@@ -152,6 +153,5 @@ namespace Discord.Rest
|
||||
else
|
||||
return AsyncEnumerable.Empty<IReadOnlyCollection<IGuildUser>>();
|
||||
}
|
||||
bool IChannel.IsNsfw => Nsfw || ChannelHelper.IsNsfw(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,7 +99,6 @@ namespace Discord.Rest
|
||||
|
||||
//IChannel
|
||||
string IChannel.Name { get { throw new NotSupportedException(); } }
|
||||
bool IChannel.IsNsfw { get { throw new NotSupportedException(); } }
|
||||
IAsyncEnumerable<IReadOnlyCollection<IUser>> IChannel.GetUsersAsync(CacheMode mode, RequestOptions options)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
|
||||
Reference in New Issue
Block a user