Fix wrong imports in examples
This commit is contained in:
parent
1863900299
commit
c139d78b34
@ -84,7 +84,7 @@ class AnswerInlineQuery(Scaffold):
|
|||||||
Example:
|
Example:
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
from pyrogram import InlineQueryResultArticle, InputTextMessageContent
|
from pyrogram.types import InlineQueryResultArticle, InputTextMessageContent
|
||||||
|
|
||||||
app.answer_inline_query(
|
app.answer_inline_query(
|
||||||
inline_query_id,
|
inline_query_id,
|
||||||
|
@ -60,7 +60,7 @@ class RestrictChatMember(Scaffold):
|
|||||||
|
|
||||||
from time import time
|
from time import time
|
||||||
|
|
||||||
from pyrogram import ChatPermissions
|
from pyrogram.types import ChatPermissions
|
||||||
|
|
||||||
# Completely restrict chat member (mute) forever
|
# Completely restrict chat member (mute) forever
|
||||||
app.restrict_chat_member(chat_id, user_id, ChatPermissions())
|
app.restrict_chat_member(chat_id, user_id, ChatPermissions())
|
||||||
|
@ -47,7 +47,7 @@ class SetChatPermissions(Scaffold):
|
|||||||
Example:
|
Example:
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
from pyrogram import ChatPermissions
|
from pyrogram.types import ChatPermissions
|
||||||
|
|
||||||
# Completely restrict chat
|
# Completely restrict chat
|
||||||
app.set_chat_permissions(chat_id, ChatPermissions())
|
app.set_chat_permissions(chat_id, ChatPermissions())
|
||||||
|
@ -40,7 +40,7 @@ class AddContacts(Scaffold):
|
|||||||
Example:
|
Example:
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
from pyrogram import InputPhoneContact
|
from pyrogram.types import InputPhoneContact
|
||||||
|
|
||||||
app.add_contacts([
|
app.add_contacts([
|
||||||
InputPhoneContact("39123456789", "Foo"),
|
InputPhoneContact("39123456789", "Foo"),
|
||||||
|
@ -54,7 +54,7 @@ class EditInlineMedia(Scaffold):
|
|||||||
Example:
|
Example:
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
from pyrogram import InputMediaPhoto, InputMediaVideo, InputMediaAudio
|
from pyrogram.types import InputMediaPhoto, InputMediaVideo, InputMediaAudio
|
||||||
|
|
||||||
# Bots only
|
# Bots only
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ class EditInlineReplyMarkup(Scaffold):
|
|||||||
Example:
|
Example:
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
from pyrogram import InlineKeyboardMarkup, InlineKeyboardButton
|
from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton
|
||||||
|
|
||||||
# Bots only
|
# Bots only
|
||||||
app.edit_inline_reply_markup(
|
app.edit_inline_reply_markup(
|
||||||
|
@ -65,7 +65,7 @@ class EditMessageMedia(Scaffold):
|
|||||||
Example:
|
Example:
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
from pyrogram import InputMediaPhoto, InputMediaVideo, InputMediaAudio
|
from pyrogram.types import InputMediaPhoto, InputMediaVideo, InputMediaAudio
|
||||||
|
|
||||||
# Replace the current media with a local photo
|
# Replace the current media with a local photo
|
||||||
app.edit_message_media(chat_id, message_id, InputMediaPhoto("new_photo.jpg"))
|
app.edit_message_media(chat_id, message_id, InputMediaPhoto("new_photo.jpg"))
|
||||||
|
@ -50,7 +50,7 @@ class EditMessageReplyMarkup(Scaffold):
|
|||||||
Example:
|
Example:
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
from pyrogram import InlineKeyboardMarkup, InlineKeyboardButton
|
from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton
|
||||||
|
|
||||||
# Bots only
|
# Bots only
|
||||||
app.edit_message_reply_markup(
|
app.edit_message_reply_markup(
|
||||||
|
@ -98,7 +98,7 @@ class SendMessage(Scaffold):
|
|||||||
# For bots only, send messages with keyboards attached
|
# For bots only, send messages with keyboards attached
|
||||||
##
|
##
|
||||||
|
|
||||||
from pyrogram import (
|
from pyrogram.types import (
|
||||||
ReplyKeyboardMarkup, InlineKeyboardMarkup, InlineKeyboardButton)
|
ReplyKeyboardMarkup, InlineKeyboardMarkup, InlineKeyboardButton)
|
||||||
|
|
||||||
# Send a normal keyboard
|
# Send a normal keyboard
|
||||||
|
@ -44,7 +44,8 @@ class AddHandler(Scaffold):
|
|||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
:emphasize-lines: 8
|
:emphasize-lines: 8
|
||||||
|
|
||||||
from pyrogram import Client, MessageHandler
|
from pyrogram import Client
|
||||||
|
from pyrogram.handlers import MessageHandler
|
||||||
|
|
||||||
def dump(client, message):
|
def dump(client, message):
|
||||||
print(message)
|
print(message)
|
||||||
|
@ -39,7 +39,8 @@ class RemoveHandler(Scaffold):
|
|||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
:emphasize-lines: 11
|
:emphasize-lines: 11
|
||||||
|
|
||||||
from pyrogram import Client, MessageHandler
|
from pyrogram import Client
|
||||||
|
from pyrogram.handlers import MessageHandler
|
||||||
|
|
||||||
def dump(client, message):
|
def dump(client, message):
|
||||||
print(message)
|
print(message)
|
||||||
|
Loading…
Reference in New Issue
Block a user