The next few steps serve as a quick start for all new Pyrogrammers that want to get something done as fast as possible. Let’s go!
Get Pyrogram Real Fast¶
Install Pyrogram with
pip3 install -U pyrogram.
Get your own Telegram API key from https://my.telegram.org/apps.
Open your best text editor and paste the following:
from pyrogram import Client api_id = 12345 api_hash = "0123456789abcdef0123456789abcdef" with Client("my_account", api_id, api_hash) as app: app.send_message("me", "Greetings from **Pyrogram**!")
Replace api_id and api_hash values with your own.
Save the file as
Run the script with
Follow the instructions on your terminal to login.
Watch Pyrogram send a message to yourself.
Join our community.
Enjoy the API¶
That was just a quick overview that barely scratched the surface! In the next few pages of the introduction, we’ll take a much more in-depth look of what we have just done above.
Feeling eager to continue? You can take a shortcut to Calling Methods and come back later to learn some more details.