Add a check when creating a tag, to ensure that it doesn't already exist
This commit is contained in:
parent
694c848517
commit
5d487a7f78
|
@ -95,6 +95,13 @@ class Tags:
|
|||
await ctx.send("Sorry, but your tag trigger was detected to be forbidden. Current forbidden tag triggers are: \n{}".format("\n".join(forbidden_tags)))
|
||||
return
|
||||
|
||||
tags = await utils.get_content('tags', str(ctx.message.guild.id))
|
||||
if tags and len(tags['tags']) > 0:
|
||||
for t in tags['tags']:
|
||||
if t['trigger'].lower().strip() == tag:
|
||||
await ctx.send("There is already a tag setup called {}!".format(trigger))
|
||||
return
|
||||
|
||||
try:
|
||||
await my_msg.delete()
|
||||
await msg.delete()
|
||||
|
|
Loading…
Reference in a new issue