Added CommandContext, fixed commands compile errors
This commit is contained in:
8
src/Discord.Net.Commands/Attributes/InAttribute.cs
Normal file
8
src/Discord.Net.Commands/Attributes/InAttribute.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using System;
|
||||
|
||||
namespace Discord.Commands
|
||||
{
|
||||
public class InAttribute : Attribute
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,6 @@ namespace Discord.Commands
|
||||
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, AllowMultiple = true, Inherited = true)]
|
||||
public abstract class PreconditionAttribute : Attribute
|
||||
{
|
||||
public abstract Task<PreconditionResult> CheckPermissions(IUserMessage context, Command executingCommand, object moduleInstance);
|
||||
public abstract Task<PreconditionResult> CheckPermissions(CommandContext context, Command executingCommand, object moduleInstance);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace Discord.Commands
|
||||
Contexts = contexts;
|
||||
}
|
||||
|
||||
public override Task<PreconditionResult> CheckPermissions(IUserMessage context, Command executingCommand, object moduleInstance)
|
||||
public override Task<PreconditionResult> CheckPermissions(CommandContext context, Command executingCommand, object moduleInstance)
|
||||
{
|
||||
bool isValid = false;
|
||||
|
||||
|
||||
@@ -20,9 +20,9 @@ namespace Discord.Commands
|
||||
GuildPermission = null;
|
||||
}
|
||||
|
||||
public override Task<PreconditionResult> CheckPermissions(IUserMessage context, Command executingCommand, object moduleInstance)
|
||||
public override Task<PreconditionResult> CheckPermissions(CommandContext context, Command executingCommand, object moduleInstance)
|
||||
{
|
||||
var guildUser = context.Author as IGuildUser;
|
||||
var guildUser = context.User as IGuildUser;
|
||||
|
||||
if (GuildPermission.HasValue)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user