Skip to content
This repository was archived by the owner on Dec 24, 2021. It is now read-only.
This repository was archived by the owner on Dec 24, 2021. It is now read-only.

Argument type: duration #182

@JohnScience

Description

@JohnScience

The most of Discord bots are expected to provide "mute" and "ban" commands. Their implementation involves juggling with parsing strings just to get so-much-desired duration.

Formats:

"3w 1d 11 [many spaces]h \t30m 20s 5ms"

Methods:

  • duration.toWeeks() -> float
  • duration.toDays() -> float
  • duration.toMinutes() -> float
  • duration.toSeconds() -> float
  • duration.toMilliseconds() -> float

And perhaps a few aliases:

  • duration.toW()
  • duration.toD()
  • duration.toM()
  • duration.toMs()

etc

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions