Quick Start
The next few steps serve as a quick start to see Electrogram in action as fast as possible.
Get Electrogram Real Fast
Install Electrogram with
pip3 install electrogram
.Get your own Telegram API key from https://my.telegram.org/apps.
Open the text editor of your choice and paste the following:
import asyncio from pyrogram import Client api_id = 12345 api_hash = "0123456789abcdef0123456789abcdef" async def main(): async with Client("my_account", api_id, api_hash) as app: await app.send_message("me", "Greetings from **Electrogram**!") asyncio.run(main())
Replace api_id and api_hash values with your own.
Save the file as
hello.py
.Run the script with
python3 hello.py
Follow the instructions on your terminal to login.
Watch Electrogram send a message to yourself.
Enjoy the API
That was just a quick overview. In the next few pages of the introduction, we’ll take a much more in-depth look of what we have just done above.
If you are feeling eager to continue you can take a shortcut to Invoking Methods and come back later to learn some more details.