Skip to content

Commit

Permalink
cooldown_thread_title and cooldown_thread_response config var, resolve
Browse files Browse the repository at this point in the history
  • Loading branch information
fourjr committed Nov 5, 2020
1 parent ef4abaf commit 66856ca
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 13 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
This project mostly adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html);
however, insignificant breaking changes do not guarantee a major version bump, see the reasoning [here](https://github.com/kyb3r/modmail/issues/319). If you're a plugins developer, note the "BREAKING" section.

# v3.6.3-dev2
# v3.7.0-dev3

### Added

Expand All @@ -16,11 +16,12 @@ however, insignificant breaking changes do not guarantee a major version bump, s
- Added `transfer_reactions` to link reactions between mods and users. ([GH #2763](https://github.com/kyb3r/modmail/issues/2763))
- Added `close_on_leave` to automatically close threads upon recipient leaving the server. ([GH #2757](https://github.com/kyb3r/modmail/issues/2757))
- Added `alert_on_mention` to mention mods upon a bot mention. ([GH #2833](https://github.com/kyb3r/modmail/issues/2833))
- Added `confirm_thread_creation`, `confirm_thread_creation_title`, `confirm_thread_creation_description`, `confirm_thread_creation_accept`, `confirm_thread_creation_deny` to allow users to confirm that they indeed want to create a new thread. ([GH #2773](https://github.com/kyb3r/modmail/issues/2773))
- Added `confirm_thread_creation`, `confirm_thread_creation_title`, `confirm_thread_response`, `confirm_thread_creation_accept`, `confirm_thread_creation_deny` to allow users to confirm that they indeed want to create a new thread. ([GH #2773](https://github.com/kyb3r/modmail/issues/2773))
- Support Gyazo image links in message embeds. ([GH #282](https://github.com/kyb3r/modmail/issues/282))
- Added `silent` argument to `?contact` to restore old behaviour.
- If `?help` is sent, bot does checks on every command, `?help all` restores old behaviour. ([GH #2847](https://github.com/kyb3r/modmail/issues/2847))
- Added a way to block roles. ([GH #2753](https://github.com/kyb3r/modmail/issues/2753))
- Added `cooldown_thread_title`, `cooldown_thread_response` to customise message sent when user is on a creating thread cooldown. ([GH #2865](https://github.com/kyb3r/modmail/issues/2865))

### Fixed

Expand Down
6 changes: 3 additions & 3 deletions bot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "3.6.3-dev2"
__version__ = "3.7.0-dev3"


import asyncio
Expand Down Expand Up @@ -753,8 +753,8 @@ async def process_dm_modmail(self, message: discord.Message) -> None:
if delta:
await message.channel.send(
embed=discord.Embed(
title="Message not sent!",
description=f"You must wait for {delta} before you can contact me again.",
title=self.config["cooldown_thread_title"],
description=self.config["cooldown_thread_response"].format(delta=delta),
color=self.error_color,
)
)
Expand Down
4 changes: 3 additions & 1 deletion core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ class ConfigManager:
"thread_move_notify": False,
"thread_move_notify_mods": False,
"thread_move_response": "This thread has been moved.",
"cooldown_thread_title": "Message not sent!",
"cooldown_thread_response": "You must wait for {delta} before you can contact me again.",
"disabled_new_thread_title": "Not Delivered",
"disabled_new_thread_response": "We are not accepting new threads.",
"disabled_new_thread_footer": "Please try again later...",
Expand All @@ -85,7 +87,7 @@ class ConfigManager:
# confirm thread creation
"confirm_thread_creation": False,
"confirm_thread_creation_title": "Confirm thread creation",
"confirm_thread_creation_description": "React to confirm thread creation which will directly contact the moderators",
"confirm_thread_response": "React to confirm thread creation which will directly contact the moderators",
"confirm_thread_creation_accept": "\u2705",
"confirm_thread_creation_deny": "\U0001F6AB",
}
Expand Down
35 changes: 29 additions & 6 deletions core/config_help.json
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,29 @@
"See also: `thread_move_title`, `thread_move_notify`."
]
},
"cooldown_thread_title": {
"default": "Message not sent!",
"description": "The title of the message embed when the user has a cooldown before creating a new thread.",
"examples": [
"`{prefix}config set cooldown_thread_title Error`"
],
"notes": [
"Only has an effect when `thread_cooldown` is set",
"See also: `cooldown_thread_response`."
]
},
"cooldown_thread_response": {
"default": "You must wait for {delta} before you can contact me again.",
"description": "The description of the message embed when the user has a cooldown before creating a new thread.",
"examples": [
"`{prefix}config set cooldown_thread_response Be patient! You are on cooldown, wait {delta} more."
],
"notes": [
"Only has an effect when `thread_cooldown` is set",
"Must have a {delta} included which will be replaced with the duration of time.",
"See also: `cooldown_thread_title`."
]
},
"disabled_new_thread_title": {
"default": "Not Delivered.",
"description": "The title of the message embed when Modmail new thread creation is disabled and user tries to create a new thread.",
Expand Down Expand Up @@ -597,7 +620,7 @@
"`{prefix}config set confirm_thread_creation yes"
],
"notes": [
"See also: `confirm_thread_creation_title`, `confirm_thread_creation_description`, `confirm_thread_creation_accept`, confirm_thread_creation_deny`"
"See also: `confirm_thread_creation_title`, `confirm_thread_response`, `confirm_thread_creation_accept`, confirm_thread_creation_deny`"
]
},
"confirm_thread_creation_title": {
Expand All @@ -607,14 +630,14 @@
"`{prefix}config set confirm_thread_creation_title Are you sure you want to create a new thread?"
],
"notes": [
"See also: `confirm_thread_creation`, `confirm_thread_creation_description`, `confirm_thread_creation_accept`, confirm_thread_creation_deny`"
"See also: `confirm_thread_creation`, `confirm_thread_response`, `confirm_thread_creation_accept`, confirm_thread_creation_deny`"
]
},
"confirm_thread_creation_description": {
"confirm_thread_response": {
"default": "React to confirm thread creation which will directly contact the moderators",
"description": "Description for the embed message sent to users to confirm a thread creation",
"examples":[
"`{prefix}config set confirm_thread_creation_description React to confirm"
"`{prefix}config set confirm_thread_response React to confirm"
],
"notes": [
"See also: `confirm_thread_creation`, `confirm_thread_creation_title`, `confirm_thread_creation_accept`, confirm_thread_creation_deny`"
Expand All @@ -627,7 +650,7 @@
"`{prefix}config set confirm_thread_creation_accept \u2611"
],
"notes": [
"See also: `confirm_thread_creation`, `confirm_thread_creation_title`, `confirm_thread_creation_description`, confirm_thread_creation_deny`"
"See also: `confirm_thread_creation`, `confirm_thread_creation_title`, `confirm_thread_response`, confirm_thread_creation_deny`"
]
},
"confirm_thread_creation_deny": {
Expand All @@ -637,7 +660,7 @@
"`{prefix}config set confirm_thread_creation_deny \u26D4"
],
"notes": [
"See also: `confirm_thread_creation`, `confirm_thread_creation_title`, `confirm_thread_creation_description`, confirm_thread_creation_accept`"
"See also: `confirm_thread_creation`, `confirm_thread_creation_title`, `confirm_thread_response`, confirm_thread_creation_accept`"
]
},
"modmail_guild_id": {
Expand Down
2 changes: 1 addition & 1 deletion core/thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -1076,7 +1076,7 @@ async def create(
confirm = await message.channel.send(
embed=discord.Embed(
title=self.bot.config["confirm_thread_creation_title"],
description=self.bot.config["confirm_thread_creation_description"],
description=self.bot.config["confirm_thread_response"],
color=self.bot.main_color,
)
)
Expand Down

0 comments on commit 66856ca

Please sign in to comment.