Skip to content

Commit be7194f

Browse files
committed
Put example descriptions at the very top of the files
1 parent fd306c3 commit be7194f

10 files changed

Lines changed: 29 additions & 28 deletions

examples/callback_query_handler.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
from pyrogram import Client
2-
31
"""This example shows how to handle callback queries, i.e.: queries coming from inline button presses.
42
5-
It uses the @on_callback_query decorator to register a CallbackQueryHandler."""
3+
It uses the @on_callback_query decorator to register a CallbackQueryHandler.
4+
"""
5+
6+
from pyrogram import Client
67

78
app = Client("123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11")
89

examples/echo_bot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
from pyrogram import Client, Filters
2-
31
"""This simple echo bot replies to every private text message.
42
53
It uses the @on_message decorator to register a MessageHandler and applies two filters on it:
64
Filters.text and Filters.private to make sure it will reply to private text messages only.
75
"""
86

7+
from pyrogram import Client, Filters
8+
99
app = Client("my_account")
1010

1111

examples/get_chat_members.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1+
"""This example shows you how to get the first 10.000 members of a chat.
2+
Refer to get_chat_members2.py for more than 10.000 members.
3+
"""
4+
15
import time
26

37
from pyrogram import Client
48
from pyrogram.api.errors import FloodWait
59

6-
"""This example shows you how to get the first 10.000 members of a chat.
7-
Refer to get_chat_members2.py for more than 10.000 members.
8-
"""
9-
1010
app = Client("my_account")
1111

1212
target = "pyrogramchat" # Target channel/supergroup

examples/get_chat_members2.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
import time
2-
from string import ascii_lowercase
3-
4-
from pyrogram import Client
5-
from pyrogram.api.errors import FloodWait
6-
71
"""This is an improved version of get_chat_members.py
82
93
Since Telegram will return at most 10.000 members for a single query, this script
@@ -13,6 +7,12 @@
137
as some user names may not contain ascii letters at all.
148
"""
159

10+
import time
11+
from string import ascii_lowercase
12+
13+
from pyrogram import Client
14+
from pyrogram.api.errors import FloodWait
15+
1616
app = Client("my_account")
1717

1818
target = "pyrogramchat" # Target channel/supergroup

examples/get_history.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
"""This example shows how to retrieve the full message history of a chat"""
2+
13
import time
24

35
from pyrogram import Client
46
from pyrogram.api.errors import FloodWait
57

6-
"""This example shows how to retrieve the full message history of a chat"""
7-
88
app = Client("my_account")
99
target = "me" # "me" refers to your own chat (Saved Messages)
1010
messages = [] # List that will contain all the messages of the target chat

examples/hello_world.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
from pyrogram import Client
2-
31
"""This example demonstrates a basic API usage"""
42

3+
from pyrogram import Client
4+
55
# Create a new Client instance
66
app = Client("my_account")
77

examples/query_inline_bots.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
from pyrogram import Client
2-
31
"""This example shows how to query an inline bot"""
42

3+
from pyrogram import Client
4+
55
# Create a new Client
66
app = Client("my_account")
77

examples/raw_update_handler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
from pyrogram import Client
2-
31
"""This example shows how to handle raw updates"""
42

3+
from pyrogram import Client
4+
55
app = Client("my_account")
66

77

examples/send_bot_keyboards.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from pyrogram import Client, ReplyKeyboardMarkup, InlineKeyboardMarkup, InlineKeyboardButton
2-
31
"""This example will show you how to send normal and inline keyboards.
42
53
You must log-in as a regular bot in order to send keyboards (use the token from @BotFather).
@@ -9,6 +7,8 @@
97
like send_audio(), send_document(), send_location(), etc...
108
"""
119

10+
from pyrogram import Client, ReplyKeyboardMarkup, InlineKeyboardMarkup, InlineKeyboardButton
11+
1212
# Create a client using your bot token
1313
app = Client("123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11")
1414
app.start()

examples/welcome_bot.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
from pyrogram import Client, Emoji, Filters
2-
31
"""This is the Welcome Bot in @PyrogramChat.
42
53
It uses the Emoji module to easily add emojis in your text messages and Filters
6-
to make it only work for specific messages in a specific chat
4+
to make it only work for specific messages in a specific chat
75
"""
86

7+
from pyrogram import Client, Emoji, Filters
8+
99
app = Client("my_account")
1010

1111

0 commit comments

Comments
 (0)