Skip to content

Commit

Permalink
Signing In docs: Clarify Bot Account section
Browse files Browse the repository at this point in the history
As mentioned in LonamiWebs#836 by kylethedeveloper, it will be clearer if we more explicitly mention the origin of the API ID and hash used in bot accounts signing in. 
Also, the example misleads that maybe bot_token results from api_id and hash_id concatenation.

- Add some minor descriptions to the bot accounts section
- Clarify and then unify the examples
  • Loading branch information
armanexplorer committed Aug 28, 2022
1 parent dd51aea commit 52d2cf0
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions readthedocs/basic/signing-in.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ We can finally write some code to log into our account!
from telethon import TelegramClient
# Use your own values from my.telegram.org
api_id = 12345
api_id = 11111
api_hash = '0123456789abcdef0123456789abcdef'
async def main():
Expand Down Expand Up @@ -94,16 +94,22 @@ Signing In as a Bot Account
===========================

You can also use Telethon for your bots (normal bot accounts, not users).
You will still need an API ID and hash, but the process is very similar:
Same as user accounts, you will need an API ID and hash of *any application*
created before.

So, still the process is very similar:


.. code-block:: python
import asyncio
from telethon import TelegramClient
api_id = 12345
# Got from application of bot owner
api_id = 11111
api_hash = '0123456789abcdef0123456789abcdef'
# Got from bot account
bot_token = '12345:0123456789abcdef0123456789abcdef'
async def main():
Expand Down

0 comments on commit 52d2cf0

Please sign in to comment.