Skip to content

Commit

Permalink
Add config to mention mods after move , resolve #215
Browse files Browse the repository at this point in the history
  • Loading branch information
fourjr committed Nov 4, 2020
1 parent feebbef commit edd3736
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ however, insignificant breaking changes do not guarantee a major version bump, s

### Added

- Plain replies: added commands `preply`, `pareply`, added config `plain_reply_without_command`. Only works from mod to users. ([#2872](https://github.com/kyb3r/modmail/issues/2872))
- Plain replies: added commands `preply`, `pareply`, added config `plain_reply_without_command`. Only works from mod to users. ([GH#2872](https://github.com/kyb3r/modmail/issues/2872))
- React to start a thread, added configs `react_to_contact_message`, `react_to_contact_emoji`.
- Mention mods after move: added config `thread_move_notify_mods` ([GH#215](https://github.com/kyb3r/modmail/issues/215))

### Fixed

Expand Down
5 changes: 5 additions & 0 deletions cogs/modmail.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,11 @@ async def move(self, ctx, *, arguments):
)
await thread.recipient.send(embed=embed)

if self.bot.config["thread_move_notify_mods"]:
mention = self.bot.config["mention"]
await thread.channel.send(f'{mention}, thread has been moved.')


sent_emoji, _ = await self.bot.retrieve_emoji()
await self.bot.add_reaction(ctx.message, sent_emoji)

Expand Down
2 changes: 2 additions & 0 deletions core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class ConfigManager:
"thread_self_close_response": "You have closed this Modmail thread.",
"thread_move_title": "Thread Moved",
"thread_move_notify": False,
"thread_move_notify_mods": False,
"thread_move_response": "This thread has been moved.",
"disabled_new_thread_title": "Not Delivered",
"disabled_new_thread_response": "We are not accepting new threads.",
Expand Down Expand Up @@ -138,6 +139,7 @@ class ConfigManager:
"recipient_thread_close",
"thread_auto_close_silently",
"thread_move_notify",
"thread_move_notify_mods",
"enable_plugins",
"enable_eval",
}
Expand Down
15 changes: 13 additions & 2 deletions core/config_help.json
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@
"`{prefix}config set thread_move_title Thread transferred to another channel!"
],
"notes": [
"See also: `thread_move_notify`, `thread_move_response`."
"See also: `thread_move_notify`, `thread_move_notify_mods`, `thread_move_response`."
]
},
"thread_move_notify": {
Expand All @@ -379,7 +379,18 @@
"`{prefix}config set thread_move_notify no`"
],
"notes": [
"See also: `thread_move_title`, `thread_move_response`."
"See also: `thread_move_title`, `thread_move_response`, `thread_move_notify_mods`."
]
},
"thread_move_notify_mods": {
"default": "No",
"description": "Notify mods again after the thread is moved",
"examples": [
"`{prefix}config set thread_move_notify_mods yes`",
"`{prefix}config set thread_move_notify_mods no`"
],
"notes": [
"See also: `thread_move_title`, `thread_move_response`, `thread_move_notify`."
]
},
"thread_move_response": {
Expand Down

0 comments on commit edd3736

Please sign in to comment.