This commit closes #36

This commit is contained in:
2023-04-03 16:03:33 +02:00
parent bd040af0cc
commit f66f8421c3
3 changed files with 37 additions and 4 deletions

View File

@@ -123,17 +123,24 @@ async def cmd_warnings(app: Client, msg: Message):
quote=should_quote(msg),
)
else:
warnings = []
for index, warning in enumerate(
list(col_warnings.find({"user": target_id, "active": True}))
):
warnings.append(
f'{index+1}. {warning["date"].strftime("%d.%m.%Y, %H:%M")}\n Адмін: {warning["admin"]}\n Причина: {warning["reason"]}'
)
if warns <= 5:
await msg.reply_text(
locale("warnings_1", "message", locale=msg.from_user).format(
target_name, target_id, warns, target_id
target_name, target_id, warns, "\n".join(warnings), target_id
),
quote=should_quote(msg),
)
else:
await msg.reply_text(
locale("warnings_2", "message", locale=msg.from_user).format(
target_name, target_id, warns, target_id
target_name, target_id, warns, "\n".join(warnings), target_id
),
quote=should_quote(msg),
)