Skip to content

Commit

Permalink
change stats view
Browse files Browse the repository at this point in the history
  • Loading branch information
salko-ua committed Jan 4, 2024
1 parent 6475bb0 commit 181fabb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion handlers/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,13 @@ async def all_people_from_db(message: Message):
all_users = await db.get_all_user()
text = "Всі Користувачі 👥"
for telegram_id, first_name, username, parsing_post, date_join in all_users:
date_join = datetime.strptime(date_join, "%Y-%m-%d %H:%M:%S.%f")
formatted_date = date_join.strftime("%Y-%m-%d %H:%M")
text += f"\nID: {telegram_id}"
text += f"\nІм`я: {first_name}"
text += f"\nПсевдонім: {username}"
text += f"\nСтворив постів: {parsing_post}"
text += f"\nПриєднався: {date_join}\n\n"
text += f"\nПриєднався: {formatted_date}\n\n"

file = types.BufferedInputFile(file=text.encode(), filename=f"Всі Користувачі.txt")
await message.answer_document(file)
Expand Down

0 comments on commit 181fabb

Please sign in to comment.