From 47e34a8ec45703cff332b1a7639b213cfe9f76f8 Mon Sep 17 00:00:00 2001 From: Nevalicjus <50320623+Nevalicjus@users.noreply.github.com> Date: Thu, 14 Apr 2022 23:45:37 +0200 Subject: [PATCH] fix to not throw errs when 1use tag not present --- cogs/invs.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cogs/invs.py b/cogs/invs.py index 4f5aa85..641ec83 100644 --- a/cogs/invs.py +++ b/cogs/invs.py @@ -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