|
17 | 17 | from core.models import PermissionLevel |
18 | 18 | from core.paginator import EmbedPaginatorSession |
19 | 19 | from core.time import UserFriendlyTime, human_timedelta |
20 | | -from core.utils import format_preview, User, create_not_found_embed, format_description |
| 20 | +from core.utils import format_preview, User, create_not_found_embed, format_description, strtobool |
21 | 21 |
|
22 | 22 | logger = logging.getLogger("Modmail") |
23 | 23 |
|
@@ -286,25 +286,34 @@ async def snippet_edit(self, ctx, name: str.lower, *, value): |
286 | 286 | @commands.command() |
287 | 287 | @checks.has_permissions(PermissionLevel.MODERATOR) |
288 | 288 | @checks.thread_only() |
289 | | - async def move(self, ctx, *, category: discord.CategoryChannel): |
| 289 | + async def move(self, ctx, category: discord.CategoryChannel, *, specifics: str = None): |
290 | 290 | """ |
291 | 291 | Move a thread to another category. |
292 | 292 |
|
293 | 293 | `category` may be a category ID, mention, or name. |
294 | 294 | """ |
295 | 295 | thread = ctx.thread |
| 296 | + silent = False |
| 297 | + |
| 298 | + if specifics: |
| 299 | + silent_words = ['silent', 'quiet'] |
| 300 | + silent = any(word in specifics for word in silent_words) |
| 301 | + |
296 | 302 | await thread.channel.edit(category=category, sync_permissions=True) |
| 303 | + |
297 | 304 | try: |
298 | | - thread_move_notify = strtobool(self.config["thread_move_notify"]) |
| 305 | + thread_move_notify = strtobool(self.bot.config["thread_move_notify"]) |
299 | 306 | except ValueError: |
300 | | - thread_move_notify = self.config.remove("thread_move_notify") |
301 | | - if thread_move_notify: |
| 307 | + thread_move_notify = self.bot.config.remove("thread_move_notify") |
| 308 | + |
| 309 | + if thread_move_notify and not silent: |
302 | 310 | embed = discord.Embed( |
303 | 311 | title="Thread Moved", |
304 | 312 | description=self.bot.config["thread_move_response"], |
305 | 313 | color=discord.Color.red()) |
306 | 314 |
|
307 | 315 | await thread.recipient.send(embed=embed) |
| 316 | + |
308 | 317 | sent_emoji, _ = await self.bot.retrieve_emoji() |
309 | 318 | try: |
310 | 319 | await ctx.message.add_reaction(sent_emoji) |
|
0 commit comments