From e55b3b2802506b489b23507676651bb602001556 Mon Sep 17 00:00:00 2001 From: brandons209 Date: Thu, 30 Jan 2020 03:09:25 -0500 Subject: [PATCH] fixed stats being tracked in dms and failing --- activitylog/activitylog.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/activitylog/activitylog.py b/activitylog/activitylog.py index 7324204..f5c02db 100644 --- a/activitylog/activitylog.py +++ b/activitylog/activitylog.py @@ -1074,7 +1074,8 @@ class ActivityLogger(commands.Cog): else: entry = MESSAGE_TEMPLATE.format(message) - if message.author.id != self.bot.user.id: # don't calculate bot stats + # don't calculate bot stats and make sure this isnt dm message + if message.author.id != self.bot.user.id and isinstance(message.author, discord.Member): async with self.config.member(message.author).stats() as stats: stats["total_msg"] += 1 if len(message.content) > 0 and message.content[0] in self.cache[message.guild.id]["prefixes"]: