|
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,14 +286,35 @@ 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 | + `specifics` is a string which takes in arguments on how to perform the move. Ex: "silently" |
294 | 295 | """ |
295 | 296 | thread = ctx.thread |
| 297 | + silent = False |
| 298 | + |
| 299 | + if specifics: |
| 300 | + silent_words = ['silent', 'silently'] |
| 301 | + silent = any(word in silent_words for word in specifics.split()) |
| 302 | + |
296 | 303 | await thread.channel.edit(category=category, sync_permissions=True) |
| 304 | + |
| 305 | + try: |
| 306 | + thread_move_notify = strtobool(self.bot.config["thread_move_notify"]) |
| 307 | + except ValueError: |
| 308 | + thread_move_notify = self.bot.config.remove("thread_move_notify") |
| 309 | + |
| 310 | + if thread_move_notify and not silent: |
| 311 | + embed = discord.Embed( |
| 312 | + title="Thread Moved", |
| 313 | + description=self.bot.config["thread_move_response"], |
| 314 | + color=self.bot.main_color |
| 315 | + |
| 316 | + await thread.recipient.send(embed=embed) |
| 317 | + |
297 | 318 | sent_emoji, _ = await self.bot.retrieve_emoji() |
298 | 319 | try: |
299 | 320 | await ctx.message.add_reaction(sent_emoji) |
|
0 commit comments