Improved analytics
This commit is contained in:
parent
1d902c75e0
commit
16f3d4bc56
@ -19,10 +19,38 @@ class Analytics(commands.Cog):
|
|||||||
and (message.author.bot == False)
|
and (message.author.bot == False)
|
||||||
and (message.author.system == False)
|
and (message.author.system == False)
|
||||||
):
|
):
|
||||||
col_analytics.insert_one(
|
stickers = []
|
||||||
|
for sticker in message.stickers:
|
||||||
|
stickers.append(
|
||||||
{
|
{
|
||||||
"message": message.content,
|
"id": sticker.id,
|
||||||
"user": message.author.id,
|
"name": sticker.name,
|
||||||
"channel": message.channel.id,
|
"format": sticker.format,
|
||||||
|
"url": sticker.url,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
attachments = []
|
||||||
|
for attachment in message.attachments:
|
||||||
|
attachments.append(
|
||||||
|
{
|
||||||
|
"content_type": attachment.content_type,
|
||||||
|
"description": attachment.description,
|
||||||
|
"filename": attachment.filename,
|
||||||
|
"is_spoiler": attachment.is_spoiler(),
|
||||||
|
"size": attachment.size,
|
||||||
|
"url": attachment.url,
|
||||||
|
"width": attachment.width,
|
||||||
|
"height": attachment.height,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
col_analytics.insert_one(
|
||||||
|
{
|
||||||
|
"user": message.author.id,
|
||||||
|
"channel": message.channel.id,
|
||||||
|
"content": message.content,
|
||||||
|
"stickers": message.stickers,
|
||||||
|
"attachments": attachments,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user