This commit closes #36
This commit is contained in:
@@ -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),
|
||||
)
|
||||
|
Reference in New Issue
Block a user