aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/apps
diff options
context:
space:
mode:
authorGravatar Joe Banks <[email protected]>2020-10-18 19:38:32 +0100
committerGravatar GitHub <[email protected]>2020-10-18 19:38:32 +0100
commit730efe6cff7b61610d97bc6d3401acf5617bd17b (patch)
treefc8d295bef25502f10704bc3d746d7353fdd1d6b /pydis_site/apps
parentMerge pull request #381 from python-discord/feat/timeline (diff)
Exclude deleted messages from total message count
Diffstat (limited to 'pydis_site/apps')
-rw-r--r--pydis_site/apps/api/models/bot/metricity.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/pydis_site/apps/api/models/bot/metricity.py b/pydis_site/apps/api/models/bot/metricity.py
index 25b42fa2..cdfbb499 100644
--- a/pydis_site/apps/api/models/bot/metricity.py
+++ b/pydis_site/apps/api/models/bot/metricity.py
@@ -33,7 +33,7 @@ class Metricity:
def total_messages(self, user_id: str) -> int:
"""Query total number of messages for a user."""
- self.cursor.execute("SELECT COUNT(*) FROM messages WHERE author_id = '%s'", [user_id])
+ self.cursor.execute("SELECT COUNT(*) FROM messages WHERE author_id = '%s' AND NOT is_deleted", [user_id])
values = self.cursor.fetchone()
if not values: