diff --git a/activitylog/activitylog.py b/activitylog/activitylog.py index 30b5711..ec86362 100644 --- a/activitylog/activitylog.py +++ b/activitylog/activitylog.py @@ -1948,7 +1948,7 @@ class ActivityLogger(commands.Cog): # ignore for now, need to figure out how to filter out when the bot fails to log a user leaving for message in data: try: - user_id = int(message.split("(id")[-1].split(")")[0].strip()) + user_id = int(message.split("(id")[-1].split(")")[0].strip().strip(":")) user = guild.get_member(user_id) if not user: continue @@ -1993,6 +1993,8 @@ class ActivityLogger(commands.Cog): pass except KeyError: # not sure why this happens... TODO figure it out pass + except ValueError: + pass else: to_delete = [] for message in data: @@ -2035,6 +2037,8 @@ class ActivityLogger(commands.Cog): pass except KeyError: # not sure why this happens... TODO figure it out pass + except ValueError: + pass # get messages around current message and add weights for j in range(max(i - 5, 0), i): @@ -2137,7 +2141,7 @@ class ActivityLogger(commands.Cog): # ignore for now, need to figure out how to filter out when the bot fails to log a user leaving for message in data: try: - user_id = int(message.split("(id")[-1].split(")")[0].strip()) + user_id = int(message.split("(id")[-1].split(")")[0].strip().strip(":")) user = guild.get_member(user_id) if not user: continue @@ -2189,6 +2193,8 @@ class ActivityLogger(commands.Cog): pass except KeyError: # not sure why this happens... TODO figure it out pass + except ValueError: + pass else: to_delete = [] for message in data: @@ -2226,6 +2232,8 @@ class ActivityLogger(commands.Cog): pass except KeyError: # not sure why this happens... TODO figure it out pass + except ValueError: + pass # get messages around current message and add weights for j in range(max(i - 5, 0), i):