Skip to content

Commit 244dd94

Browse files
committed
Added to Config: thread_move_notify and thread_move_response
Closes Issue #189
1 parent 259ba09 commit 244dd94

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

cogs/modmail.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,13 @@ async def move(self, ctx, *, category: discord.CategoryChannel):
294294
"""
295295
thread = ctx.thread
296296
await thread.channel.edit(category=category, sync_permissions=True)
297+
if self.bot.config["thread_move_notify"]:
298+
embed = discord.Embed(
299+
title="Thread Moved",
300+
description=self.bot.config["thread_move_response"],
301+
color=discord.Color.red())
302+
303+
await thread.recipient.send(embed=embed)
297304
sent_emoji, _ = await self.bot.retrieve_emoji()
298305
try:
299306
await ctx.message.add_reaction(sent_emoji)

core/config.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ class ConfigManager:
5353
"thread_close_title": "Thread Closed",
5454
"thread_close_response": "{closer.mention} has closed this Modmail thread.",
5555
"thread_self_close_response": "You have closed this Modmail thread.",
56+
"thread_move_notify": False,
57+
"thread_move_response": "This thread has been moved.",
5658
# moderation
5759
"recipient_color": str(discord.Color.gold()),
5860
"mod_color": str(discord.Color.green()),
@@ -109,6 +111,7 @@ class ConfigManager:
109111
"reply_without_command",
110112
"recipient_thread_close",
111113
"thread_auto_close_silently",
114+
"thread_move_notify",
112115
}
113116

114117
defaults = {**public_keys, **private_keys, **protected_keys}

core/config_help.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,27 @@
300300
"See also: `thread_close_title`, `thread_close_footer`, `thread_close_response`."
301301
]
302302
},
303+
"thread_move_notify": {
304+
"default": "No",
305+
"description": "Notify the recipient if the thread was moved.",
306+
"examples": [
307+
"`{prefix}config set thread_move_notify yes`",
308+
"`{prefix}config set thread_move_notify no`"
309+
],
310+
"notes": [
311+
"See also: `thread_move_response`"
312+
]
313+
},
314+
"thread_move_response": {
315+
"default": "This thread has been moved.",
316+
"description": "This is the message to display to the user when the thread is moved.",
317+
"examples": [
318+
"`{prefix}config set thread_move_response This thread has been moved to another category for review!`"
319+
],
320+
"notes": [
321+
"Only has an effect when thread_move_notify is on."
322+
]
323+
},
303324
"recipient_color": {
304325
"default": "Discord Gold [#F1C40F](https://placehold.it/100/f1c40f?text=+)",
305326
"description": "This is the color of the messages sent by the recipient, this applies to messages received in the thread channel.",

0 commit comments

Comments
 (0)