Removed IChannel#Nsfw, added to ITextChannel

This commit is contained in:
Christopher F
2017-08-29 17:26:36 -04:00
parent 5d7f2fc7ec
commit 608bc359ee
10 changed files with 14 additions and 17 deletions

View File

@@ -11,7 +11,7 @@ namespace Discord.Commands
{
public override Task<PreconditionResult> CheckPermissions(ICommandContext context, CommandInfo command, IServiceProvider services)
{
if (context.Channel.IsNsfw)
if (context.Channel is ITextChannel text && text.IsNsfw)
return Task.FromResult(PreconditionResult.FromSuccess());
else
return Task.FromResult(PreconditionResult.FromError("This command may only be invoked in an NSFW channel."));