Does some tasks from #34
This commit is contained in:
@@ -24,6 +24,8 @@ async def cmd_warn(app: Client, msg: Message):
|
||||
"admin": msg.from_user.id,
|
||||
"date": datetime.now(),
|
||||
"reason": message,
|
||||
"active": True,
|
||||
"revoke_date": None,
|
||||
}
|
||||
)
|
||||
if message == "":
|
||||
|
@@ -23,7 +23,7 @@ async def cmd_warnings(app: Client, msg: Message):
|
||||
return
|
||||
|
||||
try:
|
||||
user_db = col_users.find_one({"user": int(msg.command[1])})
|
||||
user_db = col_users.find_one({"user": int(msg.command[1]), "active": True})
|
||||
target_id = user_db["user"]
|
||||
target_name = user_db["tg_name"]
|
||||
except:
|
||||
@@ -47,7 +47,7 @@ async def cmd_warnings(app: Client, msg: Message):
|
||||
)
|
||||
return
|
||||
|
||||
warns = col_warnings.count_documents({"user": target_id})
|
||||
warns = col_warnings.count_documents({"user": target_id, "active": True})
|
||||
|
||||
if warns == 0:
|
||||
await msg.reply_text(
|
||||
|
Reference in New Issue
Block a user