Updating profile info works

This commit is contained in:
BarsTiger
2023-05-12 17:02:42 +03:00
parent aadb0d6f08
commit 5e165af00f
18 changed files with 137 additions and 9 deletions

View File

@@ -0,0 +1,22 @@
from modules.decorators.callback import async_callback
from modules.client import GeneratedClient
from modules.config import sessions
from modules.config.models import SessionConfig
from rich import print
@async_callback
async def update_info_callback(session_name: str):
print('Getting info about profile...')
await (client := GeneratedClient(name=session_name)).start()
sessions[session_name] = SessionConfig(
id=client.me.id,
phone=f'+{client.me.phone_number}',
profile_name=client.me.first_name + (f' {client.me.last_name}' if client.me.last_name else ''),
username=client.me.username
).json()
print(f'[green]Updated[/] info for {session_name}. Go back in menu to update it in interface...')
await client.stop()
input()