Remove support for TokenType.User (#958)

* Set usage of TokenType.User as an error rather than a warning.

* Remove commented sections and #pragma's

Additionally, changes use of ReadMessages to ViewChannel since that Obsolete was also suppressed by the pragma
This commit is contained in:
Joe4evr
2018-03-12 18:59:22 +01:00
committed by Christopher F
parent 170a2e00bd
commit 2fd4f5670e
5 changed files with 13 additions and 38 deletions

View File

@@ -1,4 +1,3 @@
#pragma warning disable CS0618
using System;
using System.Threading.Tasks;
@@ -20,10 +19,6 @@ namespace Discord.Commands
if (context.User.Id != application.Owner.Id)
return PreconditionResult.FromError("Command can only be run by the owner of the bot");
return PreconditionResult.FromSuccess();
case TokenType.User:
if (context.User.Id != context.Client.CurrentUser.Id)
return PreconditionResult.FromError("Command can only be run by the owner of the bot");
return PreconditionResult.FromSuccess();
default:
return PreconditionResult.FromError($"{nameof(RequireOwnerAttribute)} is not supported by this {nameof(TokenType)}.");
}