Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
44 changed files
with
1,719 additions
and
1,604 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# Docs | ||
_build/ | ||
docs/ | ||
|
||
# Generated code | ||
telethon/tl/functions/ | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
===== | ||
Users | ||
===== | ||
|
||
|
||
.. note:: | ||
|
||
These examples assume you have read :ref:`accessing-the-full-api`. | ||
|
||
|
||
Retrieving full information | ||
*************************** | ||
|
||
If you need to retrieve the bio, biography or about information for an user | ||
you should use :tl:`GetFullUser`: | ||
|
||
|
||
.. code-block:: python | ||
from telethon.tl.functions.users import GetFullUserRequest | ||
full = await client(GetFullUserRequest(user)) | ||
# or even | ||
full = await client(GetFullUserRequest('username')) | ||
bio = full.about | ||
See :tl:`UserFull` to know what other fields you can access. | ||
|
||
|
||
Updating your name and/or bio | ||
***************************** | ||
|
||
The first name, last name and bio (about) can all be changed with the same | ||
request. Omitted fields won't change after invoking :tl:`UpdateProfile`: | ||
|
||
.. code-block:: python | ||
from telethon.tl.functions.account import UpdateProfileRequest | ||
await client(UpdateProfileRequest(about='This is a test from Telethon')) | ||
Updating your username | ||
********************** | ||
|
||
You need to use :tl:`account.UpdateUsername`: | ||
|
||
.. code-block:: python | ||
from telethon.tl.functions.account import UpdateUsernameRequest | ||
await client(UpdateUsernameRequest('new_username')) | ||
Updating your profile photo | ||
*************************** | ||
|
||
The easiest way is to upload a new file and use that as the profile photo | ||
through :tl:`UploadProfilePhoto`: | ||
|
||
|
||
.. code-block:: python | ||
from telethon.tl.functions.photos import UploadProfilePhotoRequest | ||
await client(functions.photos.UploadProfilePhotoRequest( | ||
await client.upload_file('/path/to/some/file') | ||
)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.