Skip to content

Commit 4ef8033

Browse files
committed
Fix bug where snippet add did not check command name
1 parent b30e0d7 commit 4ef8033

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

cogs/modmail.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,13 @@ async def snippet_add(self, ctx, name: str.lower, *, value: commands.clean_conte
206206
{prefix}snippet add "two word" this is a two word snippet.
207207
```
208208
"""
209-
if name in self.bot.snippets:
209+
if self.bot.get_command(name):
210+
embed = discord.Embed(
211+
title="Error",
212+
color=self.bot.error_color,
213+
description=f"A command with the same name already exists: `{name}`.",
214+
)
215+
elif name in self.bot.snippets:
210216
embed = discord.Embed(
211217
title="Error",
212218
color=self.bot.error_color,

0 commit comments

Comments
 (0)