Skip to content

!superstarify default time#1532

Merged
mbaruh merged 9 commits into
python-discord:mainfrom
doublevcodes:main
Apr 19, 2021
Merged

!superstarify default time#1532
mbaruh merged 9 commits into
python-discord:mainfrom
doublevcodes:main

Conversation

@doublevcodes
Copy link
Copy Markdown
Contributor

Relevant issues

Closes #1515

Description

Makes the duration parameter optional giving it a default value of 1 hour as suggested in the issue

@Xithrius Xithrius added a: backend Related to internal functionality and utilities (error_handler, logging, security, utils and core) p: 3 - low Low Priority t: enhancement Changes or improvements to existing features a: moderation Related to community moderation functionality: (moderation, defcon, verification) labels Apr 19, 2021
Comment thread bot/exts/moderation/infraction/superstarify.py Outdated
Co-authored-by: Rohan Reddy Alleti <rohanjnr44@gmail.com>
@mbaruh
Copy link
Copy Markdown
Member

mbaruh commented Apr 19, 2021

I'm wondering if it would be better to do the same thing done to set the default duration of the mute command, meaning use the Duration converter to create the default time. This would ensure that if there is ever a change to the implementation of the converter, the behaviors won't diverge.

@RohanJnr
Copy link
Copy Markdown
Contributor

I'm wondering if it would be better to do the same thing done to set the default duration of the mute command, meaning use the Duration converter to create the default time. This would ensure that if there is ever a change to the implementation of the converter, the behaviors won't diverge.

I thought of doing that, but the Duration().converter(...) needs to parse and convert the string 1h to a timedelta object first and then add the date and timedelta object.
Whereas here, we can directly add the date and timedelta object

@mbaruh
Copy link
Copy Markdown
Member

mbaruh commented Apr 19, 2021

I thought of doing that, but the Duration().converter(...) needs to parse and convert the string 1h to a timedelta object first and then add the date and timedelta object.
Whereas here, we can directly add the date and timedelta object

True, but I don't really mind the extra operation. It's cheap and hidden anyway.

@RohanJnr
Copy link
Copy Markdown
Contributor

I thought of doing that, but the Duration().converter(...) needs to parse and convert the string 1h to a timedelta object first and then add the date and timedelta object.
Whereas here, we can directly add the date and timedelta object

True, but I don't really mind the extra operation. It's cheap and hidden anyway.

alright then, we can use the Duration() class directly

Comment thread bot/exts/moderation/infraction/superstarify.py Outdated
@RohanJnr RohanJnr requested review from mbaruh and removed request for mbaruh April 19, 2021 20:25
Comment thread bot/exts/moderation/infraction/superstarify.py Outdated
Co-authored-by: Boris Muratov <8bee278@gmail.com>
Copy link
Copy Markdown
Member

@mbaruh mbaruh left a comment

Choose a reason for hiding this comment

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

Thanks for contributing!

@mbaruh mbaruh merged commit c1c6286 into python-discord:main Apr 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: backend Related to internal functionality and utilities (error_handler, logging, security, utils and core) a: moderation Related to community moderation functionality: (moderation, defcon, verification) p: 3 - low Low Priority t: enhancement Changes or improvements to existing features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Default duration for !superstar command if no duration is specified

4 participants