[Birthday] Cog model restructure#660
Open
quachtridat wants to merge 4 commits intoSFUAnime:V3/testingfrom
Open
[Birthday] Cog model restructure#660quachtridat wants to merge 4 commits intoSFUAnime:V3/testingfrom
quachtridat wants to merge 4 commits intoSFUAnime:V3/testingfrom
Conversation
Restructure cog `Birthday` according to SFUAnime#608. No functional changes expected. Command handlers that utilize the `MonthDayConverter` now perform a "typing cast" to inform static type checkers that the birthday being passed to the command handlers as `MonthDayConverter` will be subsequently passed to the corresponding methods in `CommandsCore` as type `datetime.datetime` instead of `MonthDayConverter`. Note that Python typing cast does not change or restrict any functionalities because it is only information to static type checkers. `MonthDayConverter` now exposes the `InputType` and `OutputType` as type aliases so that code utilizes the converted can be type-hinted better. The birth year constant 2020 is moved to `constants.py` as `DEFAULT_YEAR`.
Injabie3
requested changes
May 30, 2024
Member
Injabie3
left a comment
There was a problem hiding this comment.
Sorry this was long overdue, did a first pass.
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.
Summary
Restructure cog
Birthdayaccording to #608. No functional changes expected.Notes
Command handlers that utilize the
MonthDayConverternow perform a "typing cast" to inform static type checkers that the birthday being passed to the command handlers asMonthDayConverterwill be subsequently passed to the corresponding methods inCommandsCoreas typedatetime.datetimeinstead ofMonthDayConverter. Note that Python typing cast does not change or restrict any functionalities because it is only information to static type checkers.MonthDayConverternow exposes theInputTypeandOutputTypeas type aliases so that code utilizes the converted can be type-hinted better.The birth year constant 2020 is moved to
constants.pyasDEFAULT_YEAR.Tests
The testing for this PR is done a bit specially.
Automated testing will be done by #661, and manual testing will be gradually done within this PR's thread.
Help
Add birthday
After setting the role:
After the date display timeout:
Re-adding:
Channel
Delete
After setting the role:
List
After adding a birthday:
Role
Self
After enabling the self-birthday functionality:
(the above happens in DM)
Self birthday toggle
Test
Unassign
After setting the role:
Daily add
This tests the
_dailyAddfunction inCore. The local machine's time is manually adjusted to test this.Daily sweep
This tests the
_dailySweepfunction inCore. The local machine's time is manually adjusted to test this.(the role is no longer there)