guilds: add failsafe check for same invite

This commit is contained in:
Luna 2019-03-13 04:49:50 -03:00
parent f0d4c84e68
commit 5c51894807
1 changed files with 3 additions and 0 deletions

View File

@ -413,6 +413,9 @@ async def change_vanity_url(guild_id: int):
# invites table
old_vanity = await _vanity_inv(guild_id)
if old_vanity == inv_code:
raise BadRequest('can not change to same invite')
# this is sad because we don't really use the things
# sql gives us, but i havent really found a way to put
# multiple ON CONFLICT clauses so we could UPDATE when