Erlite / Advisor

An open source and expandable administration framework for your Garry's Mod servers and addons.
MIT License
23 stars 2 forks source link

Add an argument parser for duration #26

Closed Erlite closed 3 years ago

Erlite commented 3 years ago

This will be required for things like timed bans and votes.

Examples:

!ban 60 User - Bans "User" for 60 minutes !ban 1mo2w User - Bans "User for a month and two weeks".

Should be able to parse years, months, weeks, days, hours, minutes and seconds using short suffixes. The parsed argument should be passed in the command as a number in seconds.

Erlite commented 3 years ago

Check sh_argumentparser.lua and existing parsers for implementation details.

Guthen commented 3 years ago

I'm interested in doing it

Erlite commented 3 years ago

On the subject of months, since every month has a different amount of days, consider this:

Let's say today's the 16th of October, consider one month the time between now and the 16th of November.

Erlite commented 3 years ago

@Guthen alright, it's all yours.