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:
@@ -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)}.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user