Skip to content
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

Merged
merged 6 commits into from Jun 25, 2019
Merged

This introduces thread_auto_close and thread_auto_close_response.… #302

merged 6 commits into from Jun 25, 2019

Conversation

vivekjoshy
Copy link
Contributor

… 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

Verified

This commit was signed with the committer’s verified signature.
JeanMertz Jean Mertz
… 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]:
Copy link
Collaborator

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 😛

Copy link
Contributor Author

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? 😅

Copy link
Collaborator

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..

Copy link
Collaborator

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.

Copy link
Contributor Author

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.

@kyb3r
Copy link
Collaborator

kyb3r commented Jun 24, 2019

Can you also reflect the changes in the changelog? Thanks :)

@kyb3r kyb3r merged commit 45a23ec into modmail-dev:master Jun 25, 2019
@vivekjoshy vivekjoshy deleted the auto-close-thread branch August 9, 2019 05:45
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.

suggestion: auto close ticket after specific time
3 participants