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 optional time strings to playtime commands #4

Closed
wants to merge 5 commits into from

Conversation

sleepyyapril
Copy link
Owner

About the PR

Changed the playtime commands to allow the minutes argument to take a time string instead of just a number of minutes. This can be done like this: 1y1mo1w1d1h1m, but the order and the number you put in does not matter whatsoever. If an invalid time unit is specified, it is counted as 0 minutes. This is a fully optional change; you can still do the number of minutes without issue, but this is here to automate hour-to-minute or any other time unit translation with 0 effort on an admins' part.

Here's the list of all possible units:

  • 1y - translates to 1 year in minutes
  • 1mo - translates to 1 month in minutes
  • 1w - translates to 1 week in minutes
  • 1d - translates to 1 day in minutes
  • 1h - translates to 1 hour in minutes
  • 1m - translates to 1 minute in... minutes?

Why / Balance

An issue was brought to my attention in the general chat about how annoying it is to do playtime transfer tickets. With this, I hope to make it even slightly easier on the admin team to do so.

Technical details

Most of this was changing a single line inside the commands classes to count up the minutes that were specified. Additionally, I added a new PlaytimeCommandUtilities at the top of the PlaytimeCommands.cs file to make all of this functional.

Media

image

  • I have added screenshots/videos to this PR showcasing its changes ingame, or this PR does not require an ingame showcase

Breaking changes

Changelog

🆑

  • tweak: Playtime commands can now use time strings (such as 3d30m) for the minutes argument.

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

Successfully merging this pull request may close these issues.

3 participants