Skip to content

Conversation

@Pdzly
Copy link
Contributor

@Pdzly Pdzly commented Dec 16, 2025

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 )

@Pdzly Pdzly requested a review from bristermitten December 16, 2025 19:09
@Pdzly Pdzly linked an issue Dec 16, 2025 that may be closed by this pull request
@bristermitten bristermitten requested review from Copilot and removed request for bristermitten December 21, 2025 11:49
@bristermitten
Copy link
Member

Thank you!

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 parseTimespan function (changed from element.groups?.[1/2] to element[1/2])
  • Removed unnecessary blank lines in getDuration switch statement
  • Added new docker-compose.dev.yml for 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.

Pdzly and others added 3 commits December 21, 2025 13:35
…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
@Pdzly Pdzly force-pushed the feature/210-timeout-time-versataile branch from 2e67c05 to 2e04e07 Compare December 21, 2025 12:39
@Pdzly Pdzly requested a review from bristermitten December 21, 2025 12:39
@Pdzly
Copy link
Contributor Author

Pdzly commented Dec 21, 2025

I just had some commit messages fuckery, and failed to update them correctly

@bristermitten bristermitten merged commit 1ca4d0e into TheDeveloperDen:master Dec 21, 2025
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix /timeout command to be more versatile

2 participants