Data export, warnings' improvements, bug fixes #35

Merged
profitroll merged 30 commits from dev into master 2023-04-02 23:27:31 +03:00
2 changed files with 33 additions and 1 deletions
Showing only changes of commit e235fe0ed2 - Show all commits

View File

@ -1,3 +1,4 @@
from datetime import datetime
from app import app, isAnAdmin from app import app, isAnAdmin
from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton, CallbackQuery from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton, CallbackQuery
from pyrogram import filters from pyrogram import filters
@ -12,7 +13,9 @@ async def callback_query_reject(app: Client, clb: CallbackQuery):
fullclb = clb.data.split("_") fullclb = clb.data.split("_")
if not await isAnAdmin(int(fullclb[1])): if not await isAnAdmin(int(fullclb[1])):
col_bans.insert_one({"user": int(fullclb[1])}) col_bans.insert_one(
{"user": int(fullclb[1]), "admin": clb.from_user.id, "date": datetime.now()}
)
edited_markup = [ edited_markup = [
[ [

29
validation/bans.json Normal file
View File

@ -0,0 +1,29 @@
{
"$jsonSchema": {
"required": [
"user",
"admin",
"date"
],
"properties": {
"user": {
"bsonType": [
"int",
"long"
],
"description": "Telegram ID of user"
},
"admin": {
"bsonType": [
"int",
"long"
],
"description": "Telegram ID of admin"
},
"date": {
"bsonType": "date",
"description": "Date and time of getting"
}
}
}
}