Skip to content

Commit

Permalink
show bot username
Browse files Browse the repository at this point in the history
  • Loading branch information
DeekshithSH committed May 10, 2024
1 parent 8550bd8 commit f358110
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion WebStreamer/bot/clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ async def start_client(client_id, token):
session_string=session_string,
in_memory=True,
).start()
client.id = (await client.get_me()).id
me = await client.get_me()
client.id = me.id
client.username = me.username
work_loads[client_id] = 0
return client_id, client
except Exception:
Expand Down
4 changes: 2 additions & 2 deletions WebStreamer/server/stream_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ async def root_route_handler(_):
"telegram_bot": "@" + StreamBot.username,
"connected_bots": len(multi_clients),
"loads": dict(
("bot" + str(c), l)
for c, l in sorted(work_loads.items())
("bot" + multi_clients[c].username, l)
for c, l in work_loads.items()
# for c, (_, l) in enumerate(
# sorted(work_loads.items(), key=lambda x: x[1], reverse=True)
# )
Expand Down

0 comments on commit f358110

Please sign in to comment.