The next few steps serve as a quick start to see Pyrogram in action as fast as possible.
Get Pyrogram Real Fast
If you need a cloud server to host your applications, try Hetzner Cloud. You can sign up with this link to get €20 in cloud credits.
Install Pyrogram with
pip3 install -U pyrogram.
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 **Pyrogram**!") asyncio.run(main())
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.