Skip to content

Commit 746662a

Browse files
committed
Add optional category argument in contact command
1 parent 2843fdb commit 746662a

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
# v2.7.0
8+
9+
### Changed
10+
11+
- `move` command now syncs thread channel permissions with the category that it was moved to.
12+
- `contact` command now supports an optional category argument (where the thread channel will be created).
13+
714
# v2.6.3
815

916
Fixed small issue in thread finding.

bot.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
SOFTWARE.
2323
"""
2424

25-
__version__ = '2.6.3'
25+
__version__ = '2.7.0'
2626

2727
import asyncio
2828
import textwrap

cogs/modmail.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -412,14 +412,14 @@ async def edit(self, ctx, message_id: Optional[int]=None, *, new_message):
412412
@commands.command()
413413
@trigger_typing
414414
@commands.has_permissions(manage_channels=True)
415-
async def contact(self, ctx, *, user: Union[discord.Member, discord.User]):
415+
async def contact(self, ctx, user: Union[discord.Member, discord.User], *, category: Optional[discord.CategoryChannel]=None):
416416
"""Create a thread with a specified member."""
417417

418418
exists = await self.bot.threads.find(recipient=user)
419419
if exists:
420420
return await ctx.send(embed=discord.Embed(color=discord.Color.red(), description='A thread for this user already exists.'))
421421
else:
422-
thread = await self.bot.threads.create(user, creator=ctx.author)
422+
thread = await self.bot.threads.create(user, creator=ctx.author, category=category)
423423

424424
em = discord.Embed(
425425
title='Created thread',

0 commit comments

Comments
 (0)