Skip to content

Commit 5969a4b

Browse files
committed
Contact no longer raises an error when contacting a bot, now an error message is sent
1 parent a930039 commit 5969a4b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

cogs/modmail.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,13 @@ async def contact(self, ctx,
603603
user: Union[discord.Member, discord.User]):
604604
"""Create a thread with a specified member."""
605605

606+
if user.bot:
607+
embed = discord.Embed(
608+
color=discord.Color.red(),
609+
description='Cannot start a thread with a bot.'
610+
)
611+
return await ctx.send(embed=embed)
612+
606613
exists = await self.bot.threads.find(recipient=user)
607614
if exists:
608615
embed = discord.Embed(
@@ -621,7 +628,7 @@ async def contact(self, ctx,
621628
color=self.bot.main_color
622629
)
623630

624-
return await ctx.send(embed=embed)
631+
await ctx.send(embed=embed)
625632

626633
@commands.command()
627634
@trigger_typing

0 commit comments

Comments
 (0)