Put example descriptions at the very top of the files

This commit is contained in:
Dan 2018-10-09 15:23:40 +02:00
parent fd306c383d
commit be7194f89e
10 changed files with 29 additions and 28 deletions

View File

@ -1,8 +1,9 @@
from pyrogram import Client
"""This example shows how to handle callback queries, i.e.: queries coming from inline button presses.
It uses the @on_callback_query decorator to register a CallbackQueryHandler."""
It uses the @on_callback_query decorator to register a CallbackQueryHandler.
"""
from pyrogram import Client
app = Client("123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11")

View File

@ -1,11 +1,11 @@
from pyrogram import Client, Filters
"""This simple echo bot replies to every private text message.
It uses the @on_message decorator to register a MessageHandler and applies two filters on it:
Filters.text and Filters.private to make sure it will reply to private text messages only.
"""
from pyrogram import Client, Filters
app = Client("my_account")

View File

@ -1,12 +1,12 @@
"""This example shows you how to get the first 10.000 members of a chat.
Refer to get_chat_members2.py for more than 10.000 members.
"""
import time
from pyrogram import Client
from pyrogram.api.errors import FloodWait
"""This example shows you how to get the first 10.000 members of a chat.
Refer to get_chat_members2.py for more than 10.000 members.
"""
app = Client("my_account")
target = "pyrogramchat" # Target channel/supergroup

View File

@ -1,9 +1,3 @@
import time
from string import ascii_lowercase
from pyrogram import Client
from pyrogram.api.errors import FloodWait
"""This is an improved version of get_chat_members.py
Since Telegram will return at most 10.000 members for a single query, this script
@ -13,6 +7,12 @@ This can be further improved by also searching for non-ascii characters (e.g.: J
as some user names may not contain ascii letters at all.
"""
import time
from string import ascii_lowercase
from pyrogram import Client
from pyrogram.api.errors import FloodWait
app = Client("my_account")
target = "pyrogramchat" # Target channel/supergroup

View File

@ -1,10 +1,10 @@
"""This example shows how to retrieve the full message history of a chat"""
import time
from pyrogram import Client
from pyrogram.api.errors import FloodWait
"""This example shows how to retrieve the full message history of a chat"""
app = Client("my_account")
target = "me" # "me" refers to your own chat (Saved Messages)
messages = [] # List that will contain all the messages of the target chat

View File

@ -1,7 +1,7 @@
from pyrogram import Client
"""This example demonstrates a basic API usage"""
from pyrogram import Client
# Create a new Client instance
app = Client("my_account")

View File

@ -1,7 +1,7 @@
from pyrogram import Client
"""This example shows how to query an inline bot"""
from pyrogram import Client
# Create a new Client
app = Client("my_account")

View File

@ -1,7 +1,7 @@
from pyrogram import Client
"""This example shows how to handle raw updates"""
from pyrogram import Client
app = Client("my_account")

View File

@ -1,5 +1,3 @@
from pyrogram import Client, ReplyKeyboardMarkup, InlineKeyboardMarkup, InlineKeyboardButton
"""This example will show you how to send normal and inline keyboards.
You must log-in as a regular bot in order to send keyboards (use the token from @BotFather).
@ -9,6 +7,8 @@ send_message() is used as example, but a keyboard can be sent with any other sen
like send_audio(), send_document(), send_location(), etc...
"""
from pyrogram import Client, ReplyKeyboardMarkup, InlineKeyboardMarkup, InlineKeyboardButton
# Create a client using your bot token
app = Client("123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11")
app.start()

View File

@ -1,11 +1,11 @@
from pyrogram import Client, Emoji, Filters
"""This is the Welcome Bot in @PyrogramChat.
It uses the Emoji module to easily add emojis in your text messages and Filters
to make it only work for specific messages in a specific chat
to make it only work for specific messages in a specific chat
"""
from pyrogram import Client, Emoji, Filters
app = Client("my_account")