From 019f63fd08ecffe086a425a48948e739659d39a2 Mon Sep 17 00:00:00 2001 From: Michael De Roover Date: Mon, 15 Mar 2021 01:33:40 +0100 Subject: [PATCH] Add name to .stats command --- ubot.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ubot.py b/ubot.py index 6d66768..2ef4b0a 100644 --- a/ubot.py +++ b/ubot.py @@ -62,10 +62,14 @@ async def edit(event): mentions += dialog.unread_mentions_count unread += dialog.unread_count - rpl = f'Private chats: {pms} ({pms - bots} users / {bots} bots)\n' - rpl += f'Groups: {groups} ({gadmin} admin / {gcreator} creator)\n' - rpl += f'Channels: {chans} ({cadmin} admin / {ccreator} creator)\n' - rpl += f'Unread: {unread} ({mentions} mentions)\n' + sender = await event.get_sender() + name = (sender.first_name) + + rpl = f'**Stats for {name}**\n' + rpl += f'**Private chats:** {pms} ({pms - bots} users / {bots} bots)\n' + rpl += f'**Groups:** {groups} ({gadmin} admin / {gcreator} creator)\n' + rpl += f'**Channels:** {chans} ({cadmin} admin / {ccreator} creator)\n' + rpl += f'**Unread:** {unread} ({mentions} mentions)\n' await event.edit(rpl) if '.fire' in msg: