Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pre-run condition checks on commands #1

Closed
eritbh opened this issue Oct 8, 2017 · 5 comments
Closed

Pre-run condition checks on commands #1

eritbh opened this issue Oct 8, 2017 · 5 comments
Assignees
Labels
changes: api modifies behavior of the public API enhancement something doesn't happen that should version: minor semver-minor, involves feature addition
Milestone

Comments

@eritbh
Copy link
Owner

eritbh commented Oct 8, 2017

Allow commands to set permissions that are required to execute the command. This could be done by a list of flags or a function which returns true or false based on the message that contains the command.

@eritbh eritbh changed the title API: Let commands set a function to determine a command can be executed by a given user Command permission management Oct 8, 2017
@eritbh eritbh self-assigned this Oct 8, 2017
@eritbh eritbh added the enhancement something doesn't happen that should label Oct 8, 2017
@eritbh
Copy link
Owner Author

eritbh commented Nov 13, 2017

Alternatively, just pass commands a permissions dict of true/false values and let the command figure its own stuff out. Doesn't opinionate the logic but still eliminates the need of each command to manually calculate permissions.

@eritbh
Copy link
Owner Author

eritbh commented Jan 16, 2018

Or just allow permission.has or whatever... though having a way to integrate more tightly with the help command would be nice. I've been thinking about this a lot and still don't know how best to handle it.

@eritbh eritbh added the changes: api modifies behavior of the public API label Jan 17, 2018
@eritbh eritbh added this to the 1.0 milestone Jan 17, 2018
@eritbh
Copy link
Owner Author

eritbh commented Mar 2, 2018

I'll actually just implement this as a function you pass that does this. The function will be able to return a boolean or a promise for one, and that boolean will determine whether or not the command is executed.

@eritbh eritbh changed the title Command permission management Pre-run condition checks on commands Mar 2, 2018
@eritbh eritbh added the version: minor semver-minor, involves feature addition label Mar 17, 2018
@eritbh eritbh mentioned this issue Mar 17, 2018
8 tasks
@eritbh
Copy link
Owner Author

eritbh commented Mar 17, 2018

Because screw everything I already said about it. If it were gonna be a function you might as well just include it in the main function process; providing an object of options makes more sense to me. Further thoughts will be in #12.

@eritbh eritbh closed this as completed Mar 17, 2018
@eritbh eritbh reopened this Mar 17, 2018
@eritbh eritbh modified the milestones: 1.0, 0.6.0 Mar 18, 2018
@eritbh
Copy link
Owner Author

eritbh commented May 19, 2018

fixed with #12

@eritbh eritbh closed this as completed May 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changes: api modifies behavior of the public API enhancement something doesn't happen that should version: minor semver-minor, involves feature addition
Projects
None yet
Development

No branches or pull requests

1 participant