aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Joe Banks <[email protected]>2021-12-14 19:17:15 +0000
committerGravatar GitHub <[email protected]>2021-12-14 19:17:15 +0000
commit271694571bcab2e88d97d508f66d07404b261325 (patch)
tree7b661a9954ae335f44fdfe12aa089cbb7e84ec1d
parentMerge pull request #634 from python-discord/bump-drf (diff)
parentQuery message count directly from messages (diff)
Merge pull request #635 from python-discord/revert-metricity-change
-rw-r--r--pydis_site/apps/api/models/bot/metricity.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/pydis_site/apps/api/models/bot/metricity.py b/pydis_site/apps/api/models/bot/metricity.py
index 52e946ac..901f191a 100644
--- a/pydis_site/apps/api/models/bot/metricity.py
+++ b/pydis_site/apps/api/models/bot/metricity.py
@@ -46,12 +46,14 @@ class Metricity:
self.cursor.execute(
"""
SELECT
- message_count
- FROM user_has_approx_message_count
+ COUNT(*)
+ FROM messages
WHERE
author_id = '%s'
+ AND NOT is_deleted
+ AND channel_id NOT IN %s
""",
- [user_id]
+ [user_id, EXCLUDE_CHANNELS]
)
values = self.cursor.fetchone()