Removed legacy and improved documentation
This commit is contained in:
@@ -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,
|
||||
|
Reference in New Issue
Block a user