Skip to content

Commit 13a22cf

Browse files
committedNov 21, 2021
require_close_reason config, resolves #3107
1 parent 1444c1d commit 13a22cf

File tree

5 files changed

+17
-3
lines changed

5 files changed

+17
-3
lines changed
 

‎CHANGELOG.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ however, insignificant breaking changes do not guarantee a major version bump, s
1616
### Added
1717

1818
- `use_hoisted_top_role` config to use change how default mod tags work, see `v3.10.0#Added` for details. ([PR #3093](https://github.com/kyb3r/modmail/pull/3093))
19+
- `require_close_reason` to require a reason to close a thread. ([GH #3107](https://github.com/kyb3r/modmail/issues/3107))
1920

2021
### Improved
2122

@@ -27,9 +28,9 @@ however, insignificant breaking changes do not guarantee a major version bump, s
2728
- Certain cases where fallback categories were not working as intended. ([PR #3109](https://github.com/kyb3r/modmail/pull/3109))
2829
- `?contact` would create in a random category in silent mode. ([GH #3091](https://github.com/kyb3r/modmail/issues/3091), [PR #3092](https://github.com/kyb3r/modmail/pull/3092))
2930
- Certain cases where `?close` would fail if closer isn't in cache. ([GH #3104](https://github.com/kyb3r/modmail/issues/3104), [PR #3105](https://github.com/kyb3r/modmail/pull/3105))
30-
- Stickers were not working in Modmail.
31+
- Stickers now work in Modmail.
3132
- Large server sizes results in Guild.name == None. ([GH #3088](https://github.com/kyb3r/modmail/issues/3088))
32-
- Attachments did not work on plain replies. ([GH #3102](https://github.com/kyb3r/modmail/issues/3102))
33+
- Attachments now work on plain replies. ([GH #3102](https://github.com/kyb3r/modmail/issues/3102))
3334
- Support LOTTIE stickers. ([GH #3119](https://github.com/kyb3r/modmail/issues/3119))
3435
- Editing notes now work. ([GH #3094](https://github.com/kyb3r/modmail/issues/3094))
3536

‎bot.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "3.11.0-dev3"
1+
__version__ = "3.11.0-dev2"
22

33

44
import asyncio

‎cogs/modmail.py

+3
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,9 @@ async def close(self, ctx, *, after: UserFriendlyTime = None):
419419

420420
return await ctx.send(embed=embed)
421421

422+
if self.bot.config["require_close_reason"] and message is None:
423+
raise commands.BadArgument("Provide a reason for closing the thread.")
424+
422425
if after and after.dt > now:
423426
await self.send_scheduled_close_message(ctx, after, silent)
424427

‎core/config.py

+2
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ class ConfigManager:
9191
"silent_alert_on_mention": False,
9292
"show_timestamp": True,
9393
"anonymous_snippets": False,
94+
"require_close_reason": False,
9495
# group conversations
9596
"private_added_to_group_title": "New Thread (Group)",
9697
"private_added_to_group_response": "{moderator.name} has added you to a Modmail thread.",
@@ -206,6 +207,7 @@ class ConfigManager:
206207
"update_notifications",
207208
"thread_contact_silently",
208209
"anonymous_snippets",
210+
"require_close_reason",
209211
"recipient_thread_close",
210212
"thread_show_roles",
211213
"thread_show_account_age",

‎core/config_help.json

+8
Original file line numberDiff line numberDiff line change
@@ -797,6 +797,14 @@
797797
"See also: `anon_avatar_url`, `anon_tag`."
798798
]
799799
},
800+
"require_close_reason": {
801+
"default" : "No",
802+
"description": "Require a reason to close threads.",
803+
"examples": [
804+
"`{prefix}config set require_close_reason yes`"
805+
],
806+
"notes": []
807+
},
800808
"private_added_to_group_title": {
801809
"default": "New Thread (Group)",
802810
"description": "This is the message embed title sent to the recipient that is just added to a thread.",

0 commit comments

Comments
 (0)
Please sign in to comment.