mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-11-13 04:20:37 +00:00
Finish up asyncio docs
This commit is contained in:
@@ -19,11 +19,12 @@ you should use :tl:`GetFullUser`:
|
||||
|
||||
from telethon.tl.functions.users import GetFullUserRequest
|
||||
|
||||
full = client(GetFullUserRequest(user))
|
||||
# or even
|
||||
full = client(GetFullUserRequest('username'))
|
||||
async def main():
|
||||
full = await client(GetFullUserRequest(user))
|
||||
# or even
|
||||
full = await client(GetFullUserRequest('username'))
|
||||
|
||||
bio = full.about
|
||||
bio = full.about
|
||||
|
||||
|
||||
See :tl:`UserFull` to know what other fields you can access.
|
||||
@@ -39,7 +40,9 @@ request. Omitted fields won't change after invoking :tl:`UpdateProfile`:
|
||||
|
||||
from telethon.tl.functions.account import UpdateProfileRequest
|
||||
|
||||
client(UpdateProfileRequest(about='This is a test from Telethon'))
|
||||
loop.run_until_complete(client(UpdateProfileRequest(a
|
||||
bout='This is a test from Telethon'
|
||||
)))
|
||||
|
||||
|
||||
Updating your username
|
||||
@@ -51,7 +54,7 @@ You need to use :tl:`account.UpdateUsername`:
|
||||
|
||||
from telethon.tl.functions.account import UpdateUsernameRequest
|
||||
|
||||
client(UpdateUsernameRequest('new_username'))
|
||||
loop.run_until_complete(client(UpdateUsernameRequest('new_username')))
|
||||
|
||||
|
||||
Updating your profile photo
|
||||
@@ -65,6 +68,6 @@ through :tl:`UploadProfilePhoto`:
|
||||
|
||||
from telethon.tl.functions.photos import UploadProfilePhotoRequest
|
||||
|
||||
client(UploadProfilePhotoRequest(
|
||||
loop.run_until_complete(client(UploadProfilePhotoRequest(
|
||||
client.upload_file('/path/to/some/file')
|
||||
))
|
||||
)))
|
||||
|
||||
Reference in New Issue
Block a user