import asyncio
from datetime import datetime
from telethon import TelegramClient
from telethon.tl.functions.account import UpdateProfileRequest
api_id = ""
api_hash = ""
phone = ""
session = "hour"
nick = "visualcoder"
async def update_profile():
client = TelegramClient(session=session, api_id=api_id, api_hash=api_hash)
await client.start(phone=phone)
while True:
time = datetime.now().strftime("%H:%M")
name = f"{nick}: {time}"
bio = f"Hozirgi vaqt: {time}"
await client(UpdateProfileRequest(first_name=name, about=bio))
await asyncio.sleep(60)
try:
asyncio.run(update_profile())
except:
print("o'chirildi")
๐ Pythonda telegram profilga soat o'rnatish uchun kod.
๐๐ป Kerakli kutubxonalar:
pip install asyncio datetime telethon
๐ Manba: @visualcoders
from datetime import datetime
from telethon import TelegramClient
from telethon.tl.functions.account import UpdateProfileRequest
api_id = ""
api_hash = ""
phone = ""
session = "hour"
nick = "visualcoder"
async def update_profile():
client = TelegramClient(session=session, api_id=api_id, api_hash=api_hash)
await client.start(phone=phone)
while True:
time = datetime.now().strftime("%H:%M")
name = f"{nick}: {time}"
bio = f"Hozirgi vaqt: {time}"
await client(UpdateProfileRequest(first_name=name, about=bio))
await asyncio.sleep(60)
try:
asyncio.run(update_profile())
except:
print("o'chirildi")
๐ Pythonda telegram profilga soat o'rnatish uchun kod.
๐๐ป Kerakli kutubxonalar:
pip install asyncio datetime telethon
๐ Manba: @visualcoders