diff --git a/tasks/activity.py b/tasks/activity.py index a84c6ae..e06fbc9 100644 --- a/tasks/activity.py +++ b/tasks/activity.py @@ -16,7 +16,9 @@ db = sqlitedict.SqliteDict(c.config["db"], tablename=str(c.config["guild"]), aut async def check_activity(): for author_id, timestamp in db.items(): if dt.datetime.now(dt.timezone.utc) - timestamp >= dt.timedelta(seconds=c.config["duration"]): - member = plugin.bot.cache.get_member(c.config["guild"], author_id) + member = plugin.bot.cache.get_member(c.config["guild"], author_id) or await plugin.bot.rest.fetch_member( + c.config["guild"], author_id + ) if c.config["active"] and c.config["active"] in member.role_ids: await member.remove_role(c.config["active"])