Skip to content
This repository has been archived by the owner on Jun 12, 2022. It is now read-only.

Property that auto populates middleware on construction #5

Open
Ovyerus opened this issue Jun 4, 2020 · 0 comments
Open

Property that auto populates middleware on construction #5

Ovyerus opened this issue Jun 4, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@Ovyerus
Copy link
Member

Ovyerus commented Jun 4, 2020

This would make it easier when extending the Erisa class, as users would need less "runtime" boilerplate and can make sure that everything is needed in this case.

Perhaps something like this

class MyBot extends Erisa {
    middleware = [commands(), logger()];
}

Question is, do we want to just pass the function, or the results from the function. Latter could look like:

class MyBot extends Erisa {
    middleware = [[commands, {options}], [logger, {options}]];
}

Would need to think about it.

@Ovyerus Ovyerus added the enhancement New feature or request label Jun 4, 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