Skip to content

Commit

Permalink
fix to not throw errs when 1use tag not present
Browse files Browse the repository at this point in the history
  • Loading branch information
Nevalicjus committed Apr 14, 2022
1 parent 4928666 commit 47e34a8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cogs/invs.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ async def on_invite_delete(self, invite):
if len(config["Invites"]) != len(srv_invites):
for inv in config["Invites"]:
try:
if ((inv not in srv_invites) and (config["Invites"][inv]["tags"]["1use"] == "used")):
del config["Invites"][f"{inv}"]
break
if "1use" in config["Invites"][f"{invite.code}"]["tags"]:
if ((inv not in srv_invites) and (config["Invites"][f"{inv}"]["tags"]["1use"] == "used")):
del config["Invites"][f"{inv}"]
break

except KeyError:
pass

Expand Down

0 comments on commit 47e34a8

Please sign in to comment.