Skip to content

Commit

Permalink
Add optional category argument in contact command
Browse files Browse the repository at this point in the history
  • Loading branch information
kyb3r committed Jan 20, 2019
1 parent 2843fdb commit 746662a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

# v2.7.0

### Changed

- `move` command now syncs thread channel permissions with the category that it was moved to.
- `contact` command now supports an optional category argument (where the thread channel will be created).

# v2.6.3

Fixed small issue in thread finding.
Expand Down
2 changes: 1 addition & 1 deletion bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
SOFTWARE.
"""

__version__ = '2.6.3'
__version__ = '2.7.0'

import asyncio
import textwrap
Expand Down
4 changes: 2 additions & 2 deletions cogs/modmail.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,14 +412,14 @@ async def edit(self, ctx, message_id: Optional[int]=None, *, new_message):
@commands.command()
@trigger_typing
@commands.has_permissions(manage_channels=True)
async def contact(self, ctx, *, user: Union[discord.Member, discord.User]):
async def contact(self, ctx, user: Union[discord.Member, discord.User], *, category: Optional[discord.CategoryChannel]=None):
"""Create a thread with a specified member."""

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

em = discord.Embed(
title='Created thread',
Expand Down

0 comments on commit 746662a

Please sign in to comment.