mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-01 05:04:51 +00:00
Add hello_world example
This commit is contained in:
parent
bce7d5b6e8
commit
eada298e8c
2 changed files with 19 additions and 0 deletions
19
examples/hello_world.py
Normal file
19
examples/hello_world.py
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
from pyrogram import Client
|
||||
|
||||
# Create a new Client
|
||||
client = Client("example")
|
||||
|
||||
# Start the Client
|
||||
client.start()
|
||||
|
||||
# Send a message to yourself, Markdown is enabled by default
|
||||
client.send_message("me", "Hi there! I'm using **Pyrogram**")
|
||||
|
||||
# Send a photo with a formatted caption to yourself
|
||||
client.send_photo("me", "pyrogram.png", "__This is a formatted__ **caption**")
|
||||
|
||||
# Send a location to yourself
|
||||
client.send_location("me", 51.500729, -0.124583)
|
||||
|
||||
# Stop the client
|
||||
client.stop()
|
||||
BIN
examples/pyrogram.png
Normal file
BIN
examples/pyrogram.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 40 KiB |
Loading…
Reference in a new issue