Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions pydis_site/apps/api/models/bot/metricity.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

BLOCK_INTERVAL = 10 * 60 # 10 minute blocks

EXCLUDE_CHANNELS = [
EXCLUDE_CHANNELS = (
"267659945086812160", # Bot commands
"607247579608121354" # SeasonalBot commands
]
)


class NotFoundError(Exception):
Expand Down Expand Up @@ -46,12 +46,12 @@ def total_messages(self, user_id: str) -> int:
self.cursor.execute(
"""
SELECT
COUNT(*)
COUNT(*)
FROM messages
WHERE
author_id = '%s'
AND NOT is_deleted
AND NOT %s::varchar[] @> ARRAY[channel_id]
author_id = '%s'
AND NOT is_deleted
AND channel_id NOT IN %s
""",
[user_id, EXCLUDE_CHANNELS]
)
Expand Down Expand Up @@ -79,7 +79,7 @@ def total_message_blocks(self, user_id: str) -> int:
WHERE
author_id='%s'
AND NOT is_deleted
AND NOT %s::varchar[] @> ARRAY[channel_id]
AND channel_id NOT IN %s
GROUP BY interval
) block_query;
""",
Expand Down