Data export, warnings' improvements, bug fixes #35

Merged
profitroll merged 30 commits from dev into master 2023-04-02 23:27:31 +03:00
Showing only changes of commit 3012c3d5ae - Show all commits

View File

@ -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))