Skip to content

Add feature to support 14 days and 1 year bans. fixes: #1527 - #1530

Merged
Alathreon merged 2 commits into
Together-Java:developfrom
KonstantineVashalomidze:feature/add-14-days-and-1-year-ban-option
Jul 28, 2026
Merged

Add feature to support 14 days and 1 year bans. fixes: #1527#1530
Alathreon merged 2 commits into
Together-Java:developfrom
KonstantineVashalomidze:feature/add-14-days-and-1-year-ban-option

Conversation

@KonstantineVashalomidze

@KonstantineVashalomidze KonstantineVashalomidze commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

fixes: #1527
New feature was added for admins. Admins can now also ban with durations 14 days or 1 year.

The following now looks like this:
image

Testing was done manually. I invited my friend into my test server and banned him for 14 days and 1 year. He was banned and then I have advanced system time further than 14 days and 1 year. Ban was revoked and after routine run he was unbanned.

15:35:28.878 [pool-4-thread-4] WARN  org.togetherjava.tjbot.features.help.HelpThreadActivityUpdater - Unable to update help thread activities, did not find a help forum matching the configured pattern 'questions' for guild 'Mama africa's server'
15:38:32.984 [ForkJoinPool.commonPool-worker-2] INFO  org.togetherjava.tjbot.features.moderation.BanCommand - 'kosta4115' (1021391825677860975) banned the user 'antiriad7' (488754445673431042) for 14 days from guild 'Mama africa's server' and deleted their message history of the last 0 days, for reason 'kkk'.
15:39:28.131 [ForkJoinPool.commonPool-worker-3] INFO  org.togetherjava.tjbot.features.moderation.temp.TemporaryModerationRoutine - Revoked temporary action BAN against user 'antiriad7' (488754445673431042).

Note that logs are within the same console since, I have just reloaded the project with Intellij devtools feature since I had problems with certificate when running app from scratch.

EDIT:
I have made changes as @Zabuzard and @Alathreon suggested. Since .plus(...) method doesn't support years, I had to convert number of years into number of days and use unit of DAYS to calculate ban period.

EDIT 2:
We have decided just to have 365 days option inserted instead of one 1 year.

@KonstantineVashalomidze
KonstantineVashalomidze requested a review from a team as a code owner July 25, 2026 12:57
@KonstantineVashalomidze
KonstantineVashalomidze force-pushed the feature/add-14-days-and-1-year-ban-option branch from f5cbed3 to 28b14cb Compare July 26, 2026 09:16
Alathreon
Alathreon previously approved these changes Jul 26, 2026
Zabuzard
Zabuzard previously approved these changes Jul 27, 2026
@Zabuzard

Copy link
Copy Markdown
Member

Looks liike the line is too loong or something. Can you run spotless quickly, thanks.

@KonstantineVashalomidze

Copy link
Copy Markdown
Contributor Author

Looks liike the line is too loong or something. Can you run spotless quickly, thanks.

@Zabuzard Done. spotless check passes locally.

@Alathreon
Alathreon merged commit 630502d into Together-Java:develop Jul 28, 2026
9 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.

Add 14 days and 1 year ban option

3 participants