Closed Sam-per closed 3 years ago
resolves #53
We'll want to add this to a few other commands (newer export commands coming in), so it'd be nice if it could be an method attribute, specifically a PreconditionFilter. I have an unpublished branch that does this. The class looks like:
[AttributeUsage(AttributeTargets.Method)]
public class HumanOnlyAttribute : PreconditionAttribute
{
[SuppressMessage(
"Design",
"CA1062:Validate arguments of public methods",
Justification = "Discord.Net will pass in non-null CommandContext")]
public override Task
return Task.FromResult(PreconditionResult.FromSuccess());
}
}
Assuming that your changes are already near completion, it might be more beneficial to close/reject this PR and add the attribute to the appropriate method with your changes.
Alternatively, I could change this PR to incorporate your attribute? Up to you
I can split out what I have in the next couple days and send out a PR
See #64
Assuming that none of the code here is needed and this PR is unnecessary, it can be closed
Previously, the exportToFile command could only be called by a reader or admin. Now the command can only be called by a reader or admin who is not a bot
This uses discord's isBot flag (the blue "BOT" tag)