1
0
Fork 0
mirror of synced 2024-05-20 12:32:26 +12:00

Add a check when creating a tag, to ensure that it doesn't already exist

This commit is contained in:
Phxntxm 2017-04-20 17:42:52 -05:00
parent 694c848517
commit 5d487a7f78

View file

@ -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()