Finish up asyncio docs

This commit is contained in:
Lonami Exo
2018-06-22 14:44:59 +02:00
parent 3d3698562b
commit f614d3836b
12 changed files with 255 additions and 109 deletions

View File

@@ -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')
))
)))