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

Add "warn" command #19

Open
AardWolf opened this issue Aug 3, 2017 · 1 comment
Open

Add "warn" command #19

AardWolf opened this issue Aug 3, 2017 · 1 comment
Assignees

Comments

@AardWolf
Copy link
Owner

AardWolf commented Aug 3, 2017

Usage -mh warn <area> [<sub-area>] [<num>]

If sub-area is provided warn only for that sub-area.

If num is provided then warn that many times in 15 minute intervals before the timer or sub-area timer.

Warn only warns once against the next timer.

@AardWolf AardWolf self-assigned this Aug 3, 2017
@tehhowch
Copy link
Collaborator

tehhowch commented Jun 18, 2018

If we restructure the hunters object, we could add a custom reminders field, which would create a per-user custom timeout, and activate a doCustomWarn(timer) method which uses the timer.getDemand() method instead of getAnnouncement(), as is done with the response to the next command.

To build these, I think <keyword> <timer identifiers> <units> <number> (or <numbers> <units>) could work: numbers is parsed to int, bounded positive and non-infinity, and units is normalized then passed to a Duration.fromObject constructor, e.g. warn ... 15 hr -> warn ... 15 hours -> {hours: 15}. The duration would then be bounded to be less than the repeat interval for the associated timer, and less than the max number value 2.14..... when represented as milliseconds.

This data would need to be serialized with the hunters object, and instantiated on load. We could add support for a timeout value longer than the max representable, by having it self-set the next timeout as needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants