From 9ddb1696acd0eb792daaf490a1c42aace83dbaf6 Mon Sep 17 00:00:00 2001 From: bobloy Date: Fri, 21 Aug 2020 10:32:13 -0400 Subject: [PATCH] Handle user leaving during processing --- timerole/timerole.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/timerole/timerole.py b/timerole/timerole.py index e73a19b..a103bb3 100644 --- a/timerole/timerole.py +++ b/timerole/timerole.py @@ -195,7 +195,7 @@ class Timerole(Cog): await member.add_roles(role, reason="Timerole") else: await member.remove_roles(role, reason="Timerole") - except discord.Forbidden: + except (discord.Forbidden, discord.NotFound) as e: results += "{} : {} **(Failed)**\n".format(member.display_name, role.name) else: results += "{} : {}\n".format(member.display_name, role.name)