Compare commits

...

2 Commits

Author SHA1 Message Date
Profitroll ffb3153a47 WIP: Analytics validation 2023-05-08 19:27:33 +02:00
Profitroll 64630e0ab7 Fixed sticker object type 2023-05-08 19:27:22 +02:00
2 changed files with 55 additions and 1 deletions

View File

@ -50,7 +50,7 @@ class Analytics(commands.Cog):
"user": message.author.id,
"channel": message.channel.id,
"content": message.content,
"stickers": message.stickers,
"stickers": stickers,
"attachments": attachments,
}
)

54
validation/analytics.json Normal file
View File

@ -0,0 +1,54 @@
{
"$jsonSchema": {
"required": [
"user",
"channel",
"content",
"stickers",
"attachments"
],
"properties": {
"user": {
"bsonType": "long",
"description": "Discord ID of user"
},
"channel": {
"bsonType": "int",
"description": "Discord ID of a channel"
},
"content": {
"bsonType": ["null", "string"],
"description": "Text of the message"
},
"stickers": {
"bsonType": "array",
"items": {
"bsonType": "object",
"required": [
"id",
"name",
"format",
"url"
],
"properties": {
"id": {
"bsonType": "int"
},
"name": {
"bsonType": "string"
},
"format": {
"bsonType": "array"
},
"user": {
"bsonType": "string"
}
}
}
},
"attachments": {
"bsonType": "array"
}
}
}
}