Skip to content
This repository has been archived by the owner on Oct 22, 2020. It is now read-only.

"commands" module implementation #7

Open
zikeji opened this issue Sep 28, 2020 · 0 comments
Open

"commands" module implementation #7

zikeji opened this issue Sep 28, 2020 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@zikeji
Copy link
Owner

zikeji commented Sep 28, 2020

The plan is already to use yargs-parser to let commands support both positional arguments (the default) and option arguments - like you'd see in a CLI program. This module should depend on an underlying monitor as well.

The command module should have a function for checking permissions of the user running the argument. There will be no "permission" levels, the plan is to extend the base module with a predefined check.

e.g.

export default class ModeratorCommand extends SomniaCommandModule {
  async check(message: Message): Promise<boolean> {
    return true;
  }
}

This way you'd just create base classes for each permission type you want. You can handle logic however you please and even create other classes to run to ease the amount of necessary code.

@zikeji zikeji added the enhancement New feature or request label Sep 28, 2020
@zikeji zikeji self-assigned this Sep 28, 2020
@zikeji zikeji added this to the v1.0.0 milestone Sep 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant