-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This introduces thread_auto_close
and thread_auto_close_response
.…
#302
Conversation
… Both these can be used to configure modmail to auto close a thread after some time has passed. `thread_auto_close_response` has a `%t` variable that can be used to insert human friendly time into the closing message.
@@ -336,6 +343,72 @@ def _close_after(self, closer, silent, delete_channel, message): | |||
if str(message_id) == str(embed.author.url).split("/")[-1]: | |||
return msg | |||
|
|||
async def _grab_timeout( | |||
self | |||
) -> typing.Union[None, isodate.duration.Duration, timedelta]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do this instead in one line:
async def _grab_timeout(self) -> typing.Union[None, isodate.duration.Duration, timedelta]:
Also, rename the function to _fetch_timeout
😛
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was following PEP8. Are we using a different code style? 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We follow our code style lul
whatever looks/works best i guess..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just use black for code formatting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fourjr I committed that into one line, but the second black formatting commit reverted it back.
Can you also reflect the changes in the changelog? Thanks :) |
… Both these can be used to configure modmail to auto close a thread after some time has passed.
thread_auto_close_response
has a%t
variable that can be used to insert human friendly time into the closing message.This does not auto close threads that already exist and will have to be manually closed. But once the variable is configured, it will take it from there for every new thread.
Take a look at this P.R with two sets of eyes as this is my first attempt at calling methods that I did not write.
Resolves #161