Adjusted some logic for the Timespan logic#214
Merged
bristermitten merged 3 commits intoTheDeveloperDen:masterfrom Dec 21, 2025
Merged
Adjusted some logic for the Timespan logic#214bristermitten merged 3 commits intoTheDeveloperDen:masterfrom
bristermitten merged 3 commits intoTheDeveloperDen:masterfrom
Conversation
Member
|
Thank you! |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to enable parsing of complex timespan queries with spaces like "5d 1h 50m 666s" for commands like timeout and tempban. The changes fix the incorrect use of named capture groups in the regex match results and add a development Docker Compose configuration.
Key Changes:
- Fixed regex capture group access in
parseTimespanfunction (changed fromelement.groups?.[1/2]toelement[1/2]) - Removed unnecessary blank lines in
getDurationswitch statement - Added new
docker-compose.dev.ymlfor development environment
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/util/timespan.ts | Fixes capture group access from incorrect named groups to positional array indices, enabling the regex to actually parse timespan strings |
| docker-compose.dev.yml | Adds a PostgreSQL development environment configuration with health checks |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…res setup - Remove unnecessary blank lines in `timespan.ts` - Refactor regex group access and simplify duration calculation logic
- Update regex group access from `.groups` to direct array indexing - Simplify duration calculation by using direct element access instead of optional chaining
2e67c05 to
2e04e07
Compare
Contributor
Author
|
I just had some commit messages fuckery, and failed to update them correctly |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements #210 this enables writting complex queries like
5d 1h 50m 666s ( 5 days + 1 hour + 50 minutes + 666 seconds )
( This will affect tempBan too )