Mark ChannelHelper.IsNsfw Obsolete
Discord no longer treats channels prefixed with 'nsfw' as NSFW, so we no longer need to have this check.
This commit is contained in:
@@ -338,8 +338,10 @@ namespace Discord.Rest
|
||||
return author;
|
||||
}
|
||||
|
||||
[Obsolete("Use channel.IsNsfw instead")]
|
||||
public static bool IsNsfw(IChannel channel)
|
||||
=> IsNsfw(channel.Name);
|
||||
[Obsolete("Use Channel.IsNsfw instead")]
|
||||
public static bool IsNsfw(string channelName) =>
|
||||
channelName == "nsfw" || channelName.StartsWith("nsfw-");
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace Discord.Rest
|
||||
public string Mention => MentionUtils.MentionChannel(Id);
|
||||
|
||||
private bool _nsfw;
|
||||
public bool IsNsfw => _nsfw || ChannelHelper.IsNsfw(this);
|
||||
public bool IsNsfw => _nsfw;
|
||||
|
||||
internal RestTextChannel(BaseDiscordClient discord, IGuild guild, ulong id)
|
||||
: base(discord, guild, id)
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace Discord.WebSocket
|
||||
=> CategoryId.HasValue ? Guild.GetChannel(CategoryId.Value) as ICategoryChannel : null;
|
||||
|
||||
private bool _nsfw;
|
||||
public bool IsNsfw => _nsfw || ChannelHelper.IsNsfw(this);
|
||||
public bool IsNsfw => _nsfw;
|
||||
|
||||
public string Mention => MentionUtils.MentionChannel(Id);
|
||||
public IReadOnlyCollection<SocketMessage> CachedMessages => _messages?.Messages ?? ImmutableArray.Create<SocketMessage>();
|
||||
|
||||
Reference in New Issue
Block a user