Removed legacy and improved documentation

This commit is contained in:
kku
2024-12-27 20:30:32 +01:00
parent 6060a3df83
commit 9417951f55
7 changed files with 37 additions and 83 deletions

View File

@@ -16,11 +16,13 @@ class Analytics(commands.Cog):
@Cog.listener()
async def on_message(self, message: Message) -> None:
"""Listener that collects analytical data (stickers, attachments, messages)."""
if (
(message.author != self.client.user)
and (message.author.bot is False)
and (message.author.system is False)
):
# Handle stickers
stickers: List[Dict[str, Any]] = []
for sticker in message.stickers:
@@ -33,6 +35,7 @@ class Analytics(commands.Cog):
}
)
# Handle attachments
attachments: List[Dict[str, Any]] = []
for attachment in message.attachments:
@@ -49,6 +52,7 @@ class Analytics(commands.Cog):
}
)
# Insert entry into the database
await col_analytics.insert_one(
{
"user": message.author.id,