Skip to content

Conversation

Budbomber
Copy link
Contributor

@Budbomber Budbomber commented Jan 14, 2022

Set a max duration of a week in seconds, (Not sure what the best way to do it was, so went with a 606024) 7 days in seconds.

Added required range to MAX_AGE_OPTION (0, MAX_AGE_DURATION_ONE_WEEK).

…imum.

Added: .setRequiredRange(1, TimeUnit.DAYS.toSeconds(MAX_AGE_DURATION)));
sets required range between 1 and 7 days.
…n seconds.

Added to option MAX_AGE_OPTION: .setRequiredRange(1,NAX_DURATION_ONE_WEEK));
sets required range between 1 and 7 days in seconds
@Budbomber Budbomber requested review from a team as code owners January 14, 2022 13:40
@CLAassistant
Copy link

CLAassistant commented Jan 14, 2022

CLA assistant check
All committers have signed the CLA.

@Tais993 Tais993 linked an issue Jan 14, 2022 that may be closed by this pull request
@Tais993 Tais993 added bug Something isn't working priority: normal labels Jan 14, 2022
@Tais993 Tais993 added this to the Improvement phase 1 milestone Jan 14, 2022
…c/VcActivityCommand.java


Changed, MAX_DURATION_ONE_WEEK to more readable, MAX_VALUE_MAX_AGE, and used ChronoUnit to convert seconds to days.

Co-authored-by: Tais993 <[email protected]>
@Zabuzard
Copy link
Member

Apart from what has been mentioned, looks fine. That said, what about the rest of the code? If I remember correctly, it had some check (handleIntegerOption or sth like that) which might now be (partially?) obsolete?

Please double check and if necessary clean up, thanks.

…c/VcActivityCommand.java


More readable, removed irrelevant comment

Co-authored-by: Tais993 <[email protected]>
Copy link
Contributor Author

@Budbomber Budbomber left a comment

Choose a reason for hiding this comment

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

More readable following changes, accepted suggested.

@Budbomber
Copy link
Contributor Author

Budbomber commented Jan 14, 2022

@Zabuzard

This would also mean changing max users to the same effect as age, and removing that handler totally, (I think)

@Zabuzard
Copy link
Member

Zabuzard commented Jan 14, 2022

Set a max duration of a week in seconds, (Not sure what the best way to do it was, so went with a 60_60_24) 7 days in seconds.
Added required range to MAX_AGE_OPTION (0, MAX_AGE_DURATION_ONE_WEEK).

This would also mean changing max users to the same effect as age, and the removing that handler totally

Thats fair, but what about this part of the code:

Is it really still necessary like that, or can it be simplified now?

@Budbomber
Copy link
Contributor Author

Set a max duration of a week in seconds, (Not sure what the best way to do it was, so went with a 60_60_24) 7 days in seconds.
Added required range to MAX_AGE_OPTION (0, MAX_AGE_DURATION_ONE_WEEK).

This would also mean changing max users to the same effect as age, and the removing that handler totally

Thats fair, but what about this part of the code: Is it really still necessary like that, or can it be simplified now?

Pretty sure we can just remove that, plus the calls to the error handlers

@Tais993
Copy link
Member

Tais993 commented Jan 14, 2022

I see that there also is a max to the max-uses option, see the Discord docs here

Has to be between 0 and 100, fix that too in this PR?

That way the handleIntegerTypeOption's validation regarding it being a valid Integer can be removed

@Budbomber
Copy link
Contributor Author

No worries, I'll work on that now and clean up it up

…n seconds.

Added to option MAX_AGE_OPTION: .setRequiredRange(1,NAX_DURATION_ONE_WEEK));
sets required range between 1 and 7 days in seconds
# Conflicts:
#	application/src/main/java/org/togetherjava/tjbot/commands/basic/VcActivityCommand.java
@Budbomber
Copy link
Contributor Author

No worries, I'll work on that now and clean up it up

Seems to be working now, changes made, any input appreciated

@Budbomber Budbomber requested a review from Tais993 January 14, 2022 15:49
Copy link
Contributor Author

@Budbomber Budbomber left a comment

Choose a reason for hiding this comment

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

Perfect

…c/VcActivityCommand.java


wrong values (oops)

Co-authored-by: Jonas <[email protected]>
illuminator3
illuminator3 previously approved these changes Jan 14, 2022
Copy link
Contributor

@illuminator3 illuminator3 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@Tais993 Tais993 left a comment

Choose a reason for hiding this comment

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

I personally don't like all the new lines you added, it's too many of them imo

Besides that, it looks good

@Budbomber
Copy link
Contributor Author

Yeah sorry bud must of been the merges etc I failed haha next PR I will do much neater haha

Tais993
Tais993 previously approved these changes Jan 15, 2022
illuminator3
illuminator3 previously approved these changes Jan 16, 2022
Copy link
Contributor

@illuminator3 illuminator3 left a comment

Choose a reason for hiding this comment

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

Approving this as Tijs has also approved it.

@illuminator3 illuminator3 enabled auto-merge (squash) January 16, 2022 02:19
@Zabuzard
Copy link
Member

@Budbomber Please dont resolve conversations yourself. Let them open and wait until the person who requested change approves and closes them, thanks.

auto-merge was automatically disabled January 17, 2022 10:21

Head branch was pushed to by a user without write access

@Budbomber Budbomber dismissed stale reviews from illuminator3 and Tais993 via 97ed98a January 17, 2022 10:21
…l createInvite for maxAgeDays if null default set otherwise user input set.
Zabuzard
Zabuzard previously approved these changes Jan 17, 2022
@Budbomber Budbomber requested a review from Tais993 January 17, 2022 14:46
Copy link
Member

@Tais993 Tais993 left a comment

Choose a reason for hiding this comment

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

image

@Zabuzard Zabuzard enabled auto-merge (squash) January 18, 2022 13:06
@Zabuzard Zabuzard merged commit 0be28de into Together-Java:develop Jan 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority: normal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

VC Activity command crashes
5 participants