Compare commits
4 Commits
5b8951fe07
...
e50cdd53b3
Author | SHA1 | Date | |
---|---|---|---|
e50cdd53b3 | |||
3012c3d5ae | |||
8c21ae1844 | |||
3df57f1c42 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -162,5 +162,6 @@ TASK.md
|
|||||||
inline_bot.py
|
inline_bot.py
|
||||||
.vscode
|
.vscode
|
||||||
migrate.py
|
migrate.py
|
||||||
|
venv_linux
|
||||||
validation/*
|
validation/*
|
||||||
!validation/*.json
|
!validation/*.json
|
@@ -136,6 +136,15 @@
|
|||||||
"warnings"
|
"warnings"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"warnings": {
|
||||||
|
"permissions": [
|
||||||
|
"admins",
|
||||||
|
"group_admins"
|
||||||
|
],
|
||||||
|
"modules": [
|
||||||
|
"warnings"
|
||||||
|
]
|
||||||
|
},
|
||||||
"reapply": {
|
"reapply": {
|
||||||
"permissions": [
|
"permissions": [
|
||||||
"users",
|
"users",
|
||||||
|
@@ -27,12 +27,12 @@ async def cmd_warnings(app: Client, msg: Message):
|
|||||||
if len(list_of_users) != 0:
|
if len(list_of_users) != 0:
|
||||||
target = list_of_users[0].user
|
target = list_of_users[0].user
|
||||||
target_name = target.first_name
|
target_name = target.first_name
|
||||||
target_id = str(target.id)
|
target_id = target.id
|
||||||
else:
|
else:
|
||||||
await msg.reply_text(locale("no_user_warnings", "message", locale=msg.from_user).format(msg.command[1]))
|
await msg.reply_text(locale("no_user_warnings", "message", locale=msg.from_user).format(msg.command[1]))
|
||||||
return
|
return
|
||||||
|
|
||||||
warns = len(list(col_warnings.find({"user": target_id})))
|
warns = col_warnings.count_documents({"user": target_id})
|
||||||
|
|
||||||
if warns == 0:
|
if warns == 0:
|
||||||
await msg.reply_text(locale("no_warnings", "message", locale=msg.from_user).format(target_name, target_id), quote=should_quote(msg))
|
await msg.reply_text(locale("no_warnings", "message", locale=msg.from_user).format(target_name, target_id), quote=should_quote(msg))
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
APScheduler==3.9.1.post1
|
APScheduler==3.10.0
|
||||||
fastapi~=0.88.0
|
fastapi~=0.88.0
|
||||||
psutil==5.9.4
|
psutil==5.9.4
|
||||||
pymongo==4.3.3
|
pymongo==4.3.3
|
||||||
Pyrogram~=2.0.97
|
Pyrogram~=2.0.100
|
||||||
requests==2.28.2
|
requests==2.28.2
|
||||||
tgcrypto==1.2.5
|
tgcrypto==1.2.5
|
||||||
python_dateutil==2.8.2
|
python_dateutil==2.8.2
|
||||||
|
Reference in New Issue
Block a user