mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-29 13:27:47 +00:00
Reformat code
This commit is contained in:
parent
bdb03957db
commit
3e18945f3c
@ -16,5 +16,5 @@
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from .exceptions import *
|
||||
from .error import UnknownError
|
||||
from .exceptions import *
|
||||
|
@ -21,12 +21,14 @@ from pyrogram.client.ext import BaseClient
|
||||
|
||||
|
||||
class AnswerCallbackQuery(BaseClient):
|
||||
def answer_callback_query(self,
|
||||
callback_query_id: str,
|
||||
text: str = None,
|
||||
show_alert: bool = None,
|
||||
url: str = None,
|
||||
cache_time: int = 0):
|
||||
def answer_callback_query(
|
||||
self,
|
||||
callback_query_id: str,
|
||||
text: str = None,
|
||||
show_alert: bool = None,
|
||||
url: str = None,
|
||||
cache_time: int = 0
|
||||
):
|
||||
"""Use this method to send answers to callback queries sent from inline keyboards.
|
||||
The answer will be displayed to the user as a notification at the top of the chat screen or as an alert.
|
||||
|
||||
|
@ -24,10 +24,12 @@ from pyrogram.client.ext import BaseClient
|
||||
|
||||
|
||||
class GetGameHighScores(BaseClient):
|
||||
def get_game_high_scores(self,
|
||||
user_id: Union[int, str],
|
||||
chat_id: Union[int, str],
|
||||
message_id: int = None):
|
||||
def get_game_high_scores(
|
||||
self,
|
||||
user_id: Union[int, str],
|
||||
chat_id: Union[int, str],
|
||||
message_id: int = None
|
||||
):
|
||||
"""Use this method to get data for high score tables.
|
||||
|
||||
Args:
|
||||
|
@ -24,12 +24,14 @@ from pyrogram.client.ext import BaseClient
|
||||
|
||||
|
||||
class GetInlineBotResults(BaseClient):
|
||||
def get_inline_bot_results(self,
|
||||
bot: Union[int, str],
|
||||
query: str,
|
||||
offset: str = "",
|
||||
latitude: float = None,
|
||||
longitude: float = None):
|
||||
def get_inline_bot_results(
|
||||
self,
|
||||
bot: Union[int, str],
|
||||
query: str,
|
||||
offset: str = "",
|
||||
latitude: float = None,
|
||||
longitude: float = None
|
||||
):
|
||||
"""Use this method to get bot results via inline queries.
|
||||
You can then send a result using :obj:`send_inline_bot_result <pyrogram.Client.send_inline_bot_result>`
|
||||
|
||||
|
@ -23,10 +23,12 @@ from pyrogram.client.ext import BaseClient
|
||||
|
||||
|
||||
class RequestCallbackAnswer(BaseClient):
|
||||
def request_callback_answer(self,
|
||||
chat_id: Union[int, str],
|
||||
message_id: int,
|
||||
callback_data: bytes):
|
||||
def request_callback_answer(
|
||||
self,
|
||||
chat_id: Union[int, str],
|
||||
message_id: int,
|
||||
callback_data: bytes
|
||||
):
|
||||
"""Use this method to request a callback answer from bots. This is the equivalent of clicking an
|
||||
inline button containing callback data.
|
||||
|
||||
|
@ -24,15 +24,19 @@ from pyrogram.client.ext import BaseClient
|
||||
|
||||
|
||||
class SendGame(BaseClient):
|
||||
def send_game(self,
|
||||
chat_id: Union[int, str],
|
||||
game_short_name: str,
|
||||
disable_notification: bool = None,
|
||||
reply_to_message_id: int = None,
|
||||
reply_markup: Union["pyrogram.InlineKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardRemove",
|
||||
"pyrogram.ForceReply"] = None) -> "pyrogram.Message":
|
||||
def send_game(
|
||||
self,
|
||||
chat_id: Union[int, str],
|
||||
game_short_name: str,
|
||||
disable_notification: bool = None,
|
||||
reply_to_message_id: int = None,
|
||||
reply_markup: Union[
|
||||
"pyrogram.InlineKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardRemove",
|
||||
"pyrogram.ForceReply"
|
||||
] = None
|
||||
) -> "pyrogram.Message":
|
||||
"""Use this method to send a game.
|
||||
|
||||
Args:
|
||||
|
@ -23,13 +23,15 @@ from pyrogram.client.ext import BaseClient
|
||||
|
||||
|
||||
class SendInlineBotResult(BaseClient):
|
||||
def send_inline_bot_result(self,
|
||||
chat_id: Union[int, str],
|
||||
query_id: int,
|
||||
result_id: str,
|
||||
disable_notification: bool = None,
|
||||
reply_to_message_id: int = None,
|
||||
hide_via: bool = None):
|
||||
def send_inline_bot_result(
|
||||
self,
|
||||
chat_id: Union[int, str],
|
||||
query_id: int,
|
||||
result_id: str,
|
||||
disable_notification: bool = None,
|
||||
reply_to_message_id: int = None,
|
||||
hide_via: bool = None
|
||||
):
|
||||
"""Use this method to send an inline bot result.
|
||||
Bot results can be retrieved using :obj:`get_inline_bot_results <pyrogram.Client.get_inline_bot_results>`
|
||||
|
||||
|
@ -24,13 +24,15 @@ from pyrogram.client.ext import BaseClient
|
||||
|
||||
|
||||
class SetGameScore(BaseClient):
|
||||
def set_game_score(self,
|
||||
user_id: Union[int, str],
|
||||
score: int,
|
||||
force: bool = None,
|
||||
disable_edit_message: bool = None,
|
||||
chat_id: Union[int, str] = None,
|
||||
message_id: int = None):
|
||||
def set_game_score(
|
||||
self,
|
||||
user_id: Union[int, str],
|
||||
score: int,
|
||||
force: bool = None,
|
||||
disable_edit_message: bool = None,
|
||||
chat_id: Union[int, str] = None,
|
||||
message_id: int = None
|
||||
):
|
||||
# inline_message_id: str = None): TODO Add inline_message_id
|
||||
"""Use this method to set the score of the specified user in a game.
|
||||
|
||||
|
@ -23,8 +23,10 @@ from ...ext import BaseClient
|
||||
|
||||
|
||||
class DeleteChatPhoto(BaseClient):
|
||||
def delete_chat_photo(self,
|
||||
chat_id: Union[int, str]) -> bool:
|
||||
def delete_chat_photo(
|
||||
self,
|
||||
chat_id: Union[int, str]
|
||||
) -> bool:
|
||||
"""Use this method to delete a chat photo.
|
||||
Photos can't be changed for private chats.
|
||||
You must be an administrator in the chat for this to work and must have the appropriate admin rights.
|
||||
|
@ -23,8 +23,10 @@ from ...ext import BaseClient
|
||||
|
||||
|
||||
class ExportChatInviteLink(BaseClient):
|
||||
def export_chat_invite_link(self,
|
||||
chat_id: Union[int, str]) -> str:
|
||||
def export_chat_invite_link(
|
||||
self,
|
||||
chat_id: Union[int, str]
|
||||
) -> str:
|
||||
"""Use this method to generate a new invite link for a chat; any previously generated link is revoked.
|
||||
|
||||
You must be an administrator in the chat for this to work and have the appropriate admin rights.
|
||||
|
@ -24,8 +24,10 @@ from ...ext import BaseClient
|
||||
|
||||
|
||||
class GetChat(BaseClient):
|
||||
def get_chat(self,
|
||||
chat_id: Union[int, str]) -> "pyrogram.Chat":
|
||||
def get_chat(
|
||||
self,
|
||||
chat_id: Union[int, str]
|
||||
) -> "pyrogram.Chat":
|
||||
"""Use this method to get up to date information about the chat (current name of the user for
|
||||
one-on-one conversations, current username of a user, group or channel, etc.)
|
||||
|
||||
|
@ -24,9 +24,11 @@ from ...ext import BaseClient
|
||||
|
||||
|
||||
class GetChatMember(BaseClient):
|
||||
def get_chat_member(self,
|
||||
chat_id: Union[int, str],
|
||||
user_id: Union[int, str]) -> "pyrogram.ChatMember":
|
||||
def get_chat_member(
|
||||
self,
|
||||
chat_id: Union[int, str],
|
||||
user_id: Union[int, str]
|
||||
) -> "pyrogram.ChatMember":
|
||||
"""Use this method to get information about one member of a chat.
|
||||
|
||||
Args:
|
||||
|
@ -33,12 +33,14 @@ class Filters:
|
||||
|
||||
|
||||
class GetChatMembers(BaseClient):
|
||||
def get_chat_members(self,
|
||||
chat_id: Union[int, str],
|
||||
offset: int = 0,
|
||||
limit: int = 200,
|
||||
query: str = "",
|
||||
filter: str = Filters.ALL) -> "pyrogram.ChatMembers":
|
||||
def get_chat_members(
|
||||
self,
|
||||
chat_id: Union[int, str],
|
||||
offset: int = 0,
|
||||
limit: int = 200,
|
||||
query: str = "",
|
||||
filter: str = Filters.ALL
|
||||
) -> "pyrogram.ChatMembers":
|
||||
"""Use this method to get a chunk of the members list of a chat.
|
||||
|
||||
You can get up to 200 chat members at once.
|
||||
|
@ -23,8 +23,10 @@ from ...ext import BaseClient
|
||||
|
||||
|
||||
class GetChatMembersCount(BaseClient):
|
||||
def get_chat_members_count(self,
|
||||
chat_id: Union[int, str]) -> int:
|
||||
def get_chat_members_count(
|
||||
self,
|
||||
chat_id: Union[int, str]
|
||||
) -> int:
|
||||
"""Use this method to get the number of members in a chat.
|
||||
|
||||
Args:
|
||||
|
@ -22,8 +22,10 @@ from ...ext import BaseClient
|
||||
|
||||
|
||||
class GetChatPreview(BaseClient):
|
||||
def get_chat_preview(self,
|
||||
invite_link: str):
|
||||
def get_chat_preview(
|
||||
self,
|
||||
invite_link: str
|
||||
):
|
||||
"""Use this method to get the preview of a chat using the invite link.
|
||||
|
||||
This method only returns a chat preview, if you want to join a chat use :meth:`join_chat`
|
||||
|
@ -28,10 +28,12 @@ log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class GetDialogs(BaseClient):
|
||||
def get_dialogs(self,
|
||||
offset_date: int = 0,
|
||||
limit: int = 100,
|
||||
pinned_only: bool = False) -> "pyrogram.Dialogs":
|
||||
def get_dialogs(
|
||||
self,
|
||||
offset_date: int = 0,
|
||||
limit: int = 100,
|
||||
pinned_only: bool = False
|
||||
) -> "pyrogram.Dialogs":
|
||||
"""Use this method to get a chunk of the user's dialogs
|
||||
|
||||
You can get up to 100 dialogs at once.
|
||||
|
@ -38,11 +38,13 @@ QUERYABLE_FILTERS = (Filters.ALL, Filters.KICKED, Filters.RESTRICTED)
|
||||
|
||||
|
||||
class IterChatMembers(BaseClient):
|
||||
def iter_chat_members(self,
|
||||
chat_id: Union[int, str],
|
||||
limit: int = 0,
|
||||
query: str = "",
|
||||
filter: str = Filters.ALL) -> Generator["pyrogram.ChatMember", None, None]:
|
||||
def iter_chat_members(
|
||||
self,
|
||||
chat_id: Union[int, str],
|
||||
limit: int = 0,
|
||||
query: str = "",
|
||||
filter: str = Filters.ALL
|
||||
) -> Generator["pyrogram.ChatMember", None, None]:
|
||||
"""Use this method to iterate through the members of a chat sequentially.
|
||||
|
||||
This convenience method does the same as repeatedly calling :meth:`get_chat_members` in a loop, thus saving you
|
||||
|
@ -23,9 +23,11 @@ from ...ext import BaseClient
|
||||
|
||||
|
||||
class IterDialogs(BaseClient):
|
||||
def iter_dialogs(self,
|
||||
offset_date: int = 0,
|
||||
limit: int = 0) -> Generator["pyrogram.Dialog", None, None]:
|
||||
def iter_dialogs(
|
||||
self,
|
||||
offset_date: int = 0,
|
||||
limit: int = 0
|
||||
) -> Generator["pyrogram.Dialog", None, None]:
|
||||
"""Use this method to iterate through a user's dialogs sequentially.
|
||||
|
||||
This convenience method does the same as repeatedly calling :meth:`get_dialogs` in a loop, thus saving you from
|
||||
|
@ -22,8 +22,10 @@ from ...ext import BaseClient
|
||||
|
||||
|
||||
class JoinChat(BaseClient):
|
||||
def join_chat(self,
|
||||
chat_id: str):
|
||||
def join_chat(
|
||||
self,
|
||||
chat_id: str
|
||||
):
|
||||
"""Use this method to join a group chat or channel.
|
||||
|
||||
Args:
|
||||
|
@ -24,10 +24,12 @@ from ...ext import BaseClient
|
||||
|
||||
|
||||
class KickChatMember(BaseClient):
|
||||
def kick_chat_member(self,
|
||||
chat_id: Union[int, str],
|
||||
user_id: Union[int, str],
|
||||
until_date: int = 0) -> Union["pyrogram.Message", bool]:
|
||||
def kick_chat_member(
|
||||
self,
|
||||
chat_id: Union[int, str],
|
||||
user_id: Union[int, str],
|
||||
until_date: int = 0
|
||||
) -> Union["pyrogram.Message", bool]:
|
||||
"""Use this method to kick a user from a group, a supergroup or a channel.
|
||||
In the case of supergroups and channels, the user will not be able to return to the group on their own using
|
||||
invite links, etc., unless unbanned first. You must be an administrator in the chat for this to work and must
|
||||
|
@ -23,9 +23,11 @@ from ...ext import BaseClient
|
||||
|
||||
|
||||
class LeaveChat(BaseClient):
|
||||
def leave_chat(self,
|
||||
chat_id: Union[int, str],
|
||||
delete: bool = False):
|
||||
def leave_chat(
|
||||
self,
|
||||
chat_id: Union[int, str],
|
||||
delete: bool = False
|
||||
):
|
||||
"""Use this method to leave a group chat or channel.
|
||||
|
||||
Args:
|
||||
|
@ -23,10 +23,12 @@ from ...ext import BaseClient
|
||||
|
||||
|
||||
class PinChatMessage(BaseClient):
|
||||
def pin_chat_message(self,
|
||||
chat_id: Union[int, str],
|
||||
message_id: int,
|
||||
disable_notification: bool = None) -> bool:
|
||||
def pin_chat_message(
|
||||
self,
|
||||
chat_id: Union[int, str],
|
||||
message_id: int,
|
||||
disable_notification: bool = None
|
||||
) -> bool:
|
||||
"""Use this method to pin a message in a group, channel or your own chat.
|
||||
You must be an administrator in the chat for this to work and must have the "can_pin_messages" admin right in
|
||||
the supergroup or "can_edit_messages" admin right in the channel.
|
||||
@ -55,3 +57,5 @@ class PinChatMessage(BaseClient):
|
||||
silent=disable_notification or None
|
||||
)
|
||||
)
|
||||
|
||||
return True
|
||||
|
@ -23,17 +23,19 @@ from ...ext import BaseClient
|
||||
|
||||
|
||||
class PromoteChatMember(BaseClient):
|
||||
def promote_chat_member(self,
|
||||
chat_id: Union[int, str],
|
||||
user_id: Union[int, str],
|
||||
can_change_info: bool = True,
|
||||
can_post_messages: bool = False,
|
||||
can_edit_messages: bool = False,
|
||||
can_delete_messages: bool = True,
|
||||
can_restrict_members: bool = True,
|
||||
can_invite_users: bool = True,
|
||||
can_pin_messages: bool = False,
|
||||
can_promote_members: bool = False) -> bool:
|
||||
def promote_chat_member(
|
||||
self,
|
||||
chat_id: Union[int, str],
|
||||
user_id: Union[int, str],
|
||||
can_change_info: bool = True,
|
||||
can_post_messages: bool = False,
|
||||
can_edit_messages: bool = False,
|
||||
can_delete_messages: bool = True,
|
||||
can_restrict_members: bool = True,
|
||||
can_invite_users: bool = True,
|
||||
can_pin_messages: bool = False,
|
||||
can_promote_members: bool = False
|
||||
) -> bool:
|
||||
"""Use this method to promote or demote a user in a supergroup or a channel.
|
||||
|
||||
You must be an administrator in the chat for this to work and must have the appropriate admin rights.
|
||||
|
@ -23,9 +23,11 @@ from ...ext import BaseClient
|
||||
|
||||
|
||||
class SetChatDescription(BaseClient):
|
||||
def set_chat_description(self,
|
||||
chat_id: Union[int, str],
|
||||
description: str) -> bool:
|
||||
def set_chat_description(
|
||||
self,
|
||||
chat_id: Union[int, str],
|
||||
description: str
|
||||
) -> bool:
|
||||
"""Use this method to change the description of a supergroup or a channel.
|
||||
You must be an administrator in the chat for this to work and must have the appropriate admin rights.
|
||||
|
||||
|
@ -26,9 +26,11 @@ from ...ext import BaseClient
|
||||
|
||||
|
||||
class SetChatPhoto(BaseClient):
|
||||
def set_chat_photo(self,
|
||||
chat_id: Union[int, str],
|
||||
photo: str) -> bool:
|
||||
def set_chat_photo(
|
||||
self,
|
||||
chat_id: Union[int, str],
|
||||
photo: str
|
||||
) -> bool:
|
||||
"""Use this method to set a new profile photo for the chat.
|
||||
Photos can't be changed for private chats.
|
||||
You must be an administrator in the chat for this to work and must have the appropriate admin rights.
|
||||
|
@ -23,9 +23,11 @@ from ...ext import BaseClient
|
||||
|
||||
|
||||
class SetChatTitle(BaseClient):
|
||||
def set_chat_title(self,
|
||||
chat_id: Union[int, str],
|
||||
title: str) -> bool:
|
||||
def set_chat_title(
|
||||
self,
|
||||
chat_id: Union[int, str],
|
||||
title: str
|
||||
) -> bool:
|
||||
"""Use this method to change the title of a chat.
|
||||
Titles can't be changed for private chats.
|
||||
You must be an administrator in the chat for this to work and must have the appropriate admin rights.
|
||||
|
@ -23,9 +23,11 @@ from ...ext import BaseClient
|
||||
|
||||
|
||||
class UnbanChatMember(BaseClient):
|
||||
def unban_chat_member(self,
|
||||
chat_id: Union[int, str],
|
||||
user_id: Union[int, str]) -> bool:
|
||||
def unban_chat_member(
|
||||
self,
|
||||
chat_id: Union[int, str],
|
||||
user_id: Union[int, str]
|
||||
) -> bool:
|
||||
"""Use this method to unban a previously kicked user in a supergroup or channel.
|
||||
The user will **not** return to the group or channel automatically, but will be able to join via link, etc.
|
||||
You must be an administrator for this to work.
|
||||
|
@ -23,8 +23,10 @@ from ...ext import BaseClient
|
||||
|
||||
|
||||
class UnpinChatMessage(BaseClient):
|
||||
def unpin_chat_message(self,
|
||||
chat_id: Union[int, str]) -> bool:
|
||||
def unpin_chat_message(
|
||||
self,
|
||||
chat_id: Union[int, str]
|
||||
) -> bool:
|
||||
"""Use this method to unpin a message in a group, channel or your own chat.
|
||||
You must be an administrator in the chat for this to work and must have the "can_pin_messages" admin
|
||||
right in the supergroup or "can_edit_messages" admin right in the channel.
|
||||
|
@ -23,9 +23,11 @@ from ...ext import BaseClient
|
||||
|
||||
|
||||
class UpdateChatUsername(BaseClient):
|
||||
def update_chat_username(self,
|
||||
chat_id: Union[int, str],
|
||||
username: Union[str, None]) -> bool:
|
||||
def update_chat_username(
|
||||
self,
|
||||
chat_id: Union[int, str],
|
||||
username: Union[str, None]
|
||||
) -> bool:
|
||||
"""Use this method to update a channel or a supergroup username.
|
||||
|
||||
To update your own username (for users only, not bots) you can use :meth:`update_username`.
|
||||
|
@ -24,8 +24,10 @@ from ...ext import BaseClient
|
||||
|
||||
|
||||
class AddContacts(BaseClient):
|
||||
def add_contacts(self,
|
||||
contacts: List["pyrogram.InputPhoneContact"]):
|
||||
def add_contacts(
|
||||
self,
|
||||
contacts: List["pyrogram.InputPhoneContact"]
|
||||
):
|
||||
"""Use this method to add contacts to your Telegram address book.
|
||||
|
||||
Args:
|
||||
|
@ -24,8 +24,10 @@ from ...ext import BaseClient
|
||||
|
||||
|
||||
class DeleteContacts(BaseClient):
|
||||
def delete_contacts(self,
|
||||
ids: List[int]):
|
||||
def delete_contacts(
|
||||
self,
|
||||
ids: List[int]
|
||||
):
|
||||
"""Use this method to delete contacts from your Telegram address book
|
||||
|
||||
Args:
|
||||
|
@ -25,9 +25,11 @@ from ...ext import BaseClient
|
||||
|
||||
|
||||
class OnCallbackQuery(BaseClient):
|
||||
def on_callback_query(self=None,
|
||||
filters=None,
|
||||
group: int = 0) -> callable:
|
||||
def on_callback_query(
|
||||
self=None,
|
||||
filters=None,
|
||||
group: int = 0
|
||||
) -> callable:
|
||||
"""Use this decorator to automatically register a function for handling
|
||||
callback queries. This does the same thing as :meth:`add_handler` using the
|
||||
:class:`CallbackQueryHandler`.
|
||||
|
@ -25,9 +25,11 @@ from ...ext import BaseClient
|
||||
|
||||
|
||||
class OnDeletedMessages(BaseClient):
|
||||
def on_deleted_messages(self=None,
|
||||
filters=None,
|
||||
group: int = 0) -> callable:
|
||||
def on_deleted_messages(
|
||||
self=None,
|
||||
filters=None,
|
||||
group: int = 0
|
||||
) -> callable:
|
||||
"""Use this decorator to automatically register a function for handling
|
||||
deleted messages. This does the same thing as :meth:`add_handler` using the
|
||||
:class:`DeletedMessagesHandler`.
|
||||
|
@ -25,9 +25,11 @@ from ...ext import BaseClient
|
||||
|
||||
|
||||
class OnMessage(BaseClient):
|
||||
def on_message(self=None,
|
||||
filters=None,
|
||||
group: int = 0) -> callable:
|
||||
def on_message(
|
||||
self=None,
|
||||
filters=None,
|
||||
group: int = 0
|
||||
) -> callable:
|
||||
"""Use this decorator to automatically register a function for handling
|
||||
messages. This does the same thing as :meth:`add_handler` using the
|
||||
:class:`MessageHandler`.
|
||||
|
@ -24,8 +24,10 @@ from ...ext import BaseClient
|
||||
|
||||
|
||||
class OnRawUpdate(BaseClient):
|
||||
def on_raw_update(self=None,
|
||||
group: int = 0) -> callable:
|
||||
def on_raw_update(
|
||||
self=None,
|
||||
group: int = 0
|
||||
) -> callable:
|
||||
"""Use this decorator to automatically register a function for handling
|
||||
raw updates. This does the same thing as :meth:`add_handler` using the
|
||||
:class:`RawUpdateHandler`.
|
||||
|
@ -25,9 +25,11 @@ from ...ext import BaseClient
|
||||
|
||||
|
||||
class OnUserStatus(BaseClient):
|
||||
def on_user_status(self=None,
|
||||
filters=None,
|
||||
group: int = 0) -> callable:
|
||||
def on_user_status(
|
||||
self=None,
|
||||
filters=None,
|
||||
group: int = 0
|
||||
) -> callable:
|
||||
"""Use this decorator to automatically register a function for handling
|
||||
user status updates. This does the same thing as :meth:`add_handler` using the
|
||||
:class:`UserStatusHandler`.
|
||||
|
@ -23,9 +23,11 @@ from pyrogram.client.ext import BaseClient
|
||||
|
||||
|
||||
class ClosePoll(BaseClient):
|
||||
def close_poll(self,
|
||||
chat_id: Union[int, str],
|
||||
message_id: id) -> bool:
|
||||
def close_poll(
|
||||
self,
|
||||
chat_id: Union[int, str],
|
||||
message_id: id
|
||||
) -> bool:
|
||||
"""Use this method to close (stop) a poll.
|
||||
|
||||
Closed polls can't be reopened and nobody will be able to vote in it anymore.
|
||||
|
@ -23,10 +23,12 @@ from pyrogram.client.ext import BaseClient
|
||||
|
||||
|
||||
class DeleteMessages(BaseClient):
|
||||
def delete_messages(self,
|
||||
chat_id: Union[int, str],
|
||||
message_ids: Iterable[int],
|
||||
revoke: bool = True) -> bool:
|
||||
def delete_messages(
|
||||
self,
|
||||
chat_id: Union[int, str],
|
||||
message_ids: Iterable[int],
|
||||
revoke: bool = True
|
||||
) -> bool:
|
||||
"""Use this method to delete messages, including service messages, with the following limitations:
|
||||
|
||||
- A message can only be deleted if it was sent less than 48 hours ago.
|
||||
|
@ -24,12 +24,14 @@ from pyrogram.client.ext import BaseClient
|
||||
|
||||
|
||||
class DownloadMedia(BaseClient):
|
||||
def download_media(self,
|
||||
message: Union["pyrogram.Message", str],
|
||||
file_name: str = "",
|
||||
block: bool = True,
|
||||
progress: callable = None,
|
||||
progress_args: tuple = ()) -> Union[str, None]:
|
||||
def download_media(
|
||||
self,
|
||||
message: Union["pyrogram.Message", str],
|
||||
file_name: str = "",
|
||||
block: bool = True,
|
||||
progress: callable = None,
|
||||
progress_args: tuple = ()
|
||||
) -> Union[str, None]:
|
||||
"""Use this method to download the media from a Message.
|
||||
|
||||
Args:
|
||||
|
@ -24,12 +24,14 @@ from pyrogram.client.ext import BaseClient
|
||||
|
||||
|
||||
class EditMessageCaption(BaseClient):
|
||||
def edit_message_caption(self,
|
||||
chat_id: Union[int, str],
|
||||
message_id: int,
|
||||
caption: str,
|
||||
parse_mode: str = "",
|
||||
reply_markup: "pyrogram.InlineKeyboardMarkup" = None) -> "pyrogram.Message":
|
||||
def edit_message_caption(
|
||||
self,
|
||||
chat_id: Union[int, str],
|
||||
message_id: int,
|
||||
caption: str,
|
||||
parse_mode: str = "",
|
||||
reply_markup: "pyrogram.InlineKeyboardMarkup" = None
|
||||
) -> "pyrogram.Message":
|
||||
"""Use this method to edit captions of messages.
|
||||
|
||||
Args:
|
||||
|
@ -33,11 +33,13 @@ from pyrogram.client.types.input_media import InputMedia
|
||||
|
||||
|
||||
class EditMessageMedia(BaseClient):
|
||||
def edit_message_media(self,
|
||||
chat_id: Union[int, str],
|
||||
message_id: int,
|
||||
media: InputMedia,
|
||||
reply_markup: "pyrogram.InlineKeyboardMarkup" = None) -> "pyrogram.Message":
|
||||
def edit_message_media(
|
||||
self,
|
||||
chat_id: Union[int, str],
|
||||
message_id: int,
|
||||
media: InputMedia,
|
||||
reply_markup: "pyrogram.InlineKeyboardMarkup" = None
|
||||
) -> "pyrogram.Message":
|
||||
"""Use this method to edit audio, document, photo, or video messages.
|
||||
|
||||
If a message is a part of a message album, then it can be edited only to a photo or a video. Otherwise,
|
||||
|
@ -24,10 +24,12 @@ from pyrogram.client.ext import BaseClient
|
||||
|
||||
|
||||
class EditMessageReplyMarkup(BaseClient):
|
||||
def edit_message_reply_markup(self,
|
||||
chat_id: Union[int, str],
|
||||
message_id: int,
|
||||
reply_markup: "pyrogram.InlineKeyboardMarkup" = None) -> "pyrogram.Message":
|
||||
def edit_message_reply_markup(
|
||||
self,
|
||||
chat_id: Union[int, str],
|
||||
message_id: int,
|
||||
reply_markup: "pyrogram.InlineKeyboardMarkup" = None
|
||||
) -> "pyrogram.Message":
|
||||
"""Use this method to edit only the reply markup of messages sent by the bot or via the bot (for inline bots).
|
||||
|
||||
Args:
|
||||
|
@ -24,13 +24,15 @@ from pyrogram.client.ext import BaseClient
|
||||
|
||||
|
||||
class EditMessageText(BaseClient):
|
||||
def edit_message_text(self,
|
||||
chat_id: Union[int, str],
|
||||
message_id: int,
|
||||
text: str,
|
||||
parse_mode: str = "",
|
||||
disable_web_page_preview: bool = None,
|
||||
reply_markup: "pyrogram.InlineKeyboardMarkup" = None) -> "pyrogram.Message":
|
||||
def edit_message_text(
|
||||
self,
|
||||
chat_id: Union[int, str],
|
||||
message_id: int,
|
||||
text: str,
|
||||
parse_mode: str = "",
|
||||
disable_web_page_preview: bool = None,
|
||||
reply_markup: "pyrogram.InlineKeyboardMarkup" = None
|
||||
) -> "pyrogram.Message":
|
||||
"""Use this method to edit text messages.
|
||||
|
||||
Args:
|
||||
|
@ -24,11 +24,13 @@ from ...ext import BaseClient
|
||||
|
||||
|
||||
class ForwardMessages(BaseClient):
|
||||
def forward_messages(self,
|
||||
chat_id: Union[int, str],
|
||||
from_chat_id: Union[int, str],
|
||||
message_ids: Iterable[int],
|
||||
disable_notification: bool = None) -> "pyrogram.Messages":
|
||||
def forward_messages(
|
||||
self,
|
||||
chat_id: Union[int, str],
|
||||
from_chat_id: Union[int, str],
|
||||
message_ids: Iterable[int],
|
||||
disable_notification: bool = None
|
||||
) -> "pyrogram.Messages":
|
||||
"""Use this method to forward messages of any kind.
|
||||
|
||||
Args:
|
||||
|
@ -29,13 +29,15 @@ log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class GetHistory(BaseClient):
|
||||
def get_history(self,
|
||||
chat_id: Union[int, str],
|
||||
limit: int = 100,
|
||||
offset: int = 0,
|
||||
offset_id: int = 0,
|
||||
offset_date: int = 0,
|
||||
reverse: bool = False):
|
||||
def get_history(
|
||||
self,
|
||||
chat_id: Union[int, str],
|
||||
limit: int = 100,
|
||||
offset: int = 0,
|
||||
offset_id: int = 0,
|
||||
offset_date: int = 0,
|
||||
reverse: bool = False
|
||||
):
|
||||
"""Use this method to retrieve a chunk of the history of a chat.
|
||||
|
||||
You can get up to 100 messages at once.
|
||||
|
@ -29,11 +29,13 @@ log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class GetMessages(BaseClient):
|
||||
def get_messages(self,
|
||||
chat_id: Union[int, str],
|
||||
message_ids: Union[int, Iterable[int]] = None,
|
||||
reply_to_message_ids: Union[int, Iterable[int]] = None,
|
||||
replies: int = 1) -> Union["pyrogram.Message", "pyrogram.Messages"]:
|
||||
def get_messages(
|
||||
self,
|
||||
chat_id: Union[int, str],
|
||||
message_ids: Union[int, Iterable[int]] = None,
|
||||
reply_to_message_ids: Union[int, Iterable[int]] = None,
|
||||
replies: int = 1
|
||||
) -> Union["pyrogram.Message", "pyrogram.Messages"]:
|
||||
"""Use this method to get one or more messages that belong to a specific chat.
|
||||
You can retrieve up to 200 messages at once.
|
||||
|
||||
|
@ -23,13 +23,15 @@ from ...ext import BaseClient
|
||||
|
||||
|
||||
class IterHistory(BaseClient):
|
||||
def iter_history(self,
|
||||
chat_id: Union[int, str],
|
||||
limit: int = 0,
|
||||
offset: int = 0,
|
||||
offset_id: int = 0,
|
||||
offset_date: int = 0,
|
||||
reverse: bool = False) -> Generator["pyrogram.Message", None, None]:
|
||||
def iter_history(
|
||||
self,
|
||||
chat_id: Union[int, str],
|
||||
limit: int = 0,
|
||||
offset: int = 0,
|
||||
offset_id: int = 0,
|
||||
offset_date: int = 0,
|
||||
reverse: bool = False
|
||||
) -> Generator["pyrogram.Message", None, None]:
|
||||
"""Use this method to iterate through a chat history sequentially.
|
||||
|
||||
This convenience method does the same as repeatedly calling :meth:`get_history` in a loop, thus saving you from
|
||||
|
@ -23,9 +23,11 @@ from pyrogram.client.ext import BaseClient
|
||||
|
||||
|
||||
class RetractVote(BaseClient):
|
||||
def retract_vote(self,
|
||||
chat_id: Union[int, str],
|
||||
message_id: id) -> bool:
|
||||
def retract_vote(
|
||||
self,
|
||||
chat_id: Union[int, str],
|
||||
message_id: id
|
||||
) -> bool:
|
||||
"""Use this method to retract your vote in a poll.
|
||||
|
||||
Args:
|
||||
|
@ -28,23 +28,27 @@ from pyrogram.client.ext import BaseClient, utils
|
||||
|
||||
|
||||
class SendAnimation(BaseClient):
|
||||
def send_animation(self,
|
||||
chat_id: Union[int, str],
|
||||
animation: str,
|
||||
caption: str = "",
|
||||
parse_mode: str = "",
|
||||
duration: int = 0,
|
||||
width: int = 0,
|
||||
height: int = 0,
|
||||
thumb: str = None,
|
||||
disable_notification: bool = None,
|
||||
reply_to_message_id: int = None,
|
||||
reply_markup: Union["pyrogram.InlineKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardRemove",
|
||||
"pyrogram.ForceReply"] = None,
|
||||
progress: callable = None,
|
||||
progress_args: tuple = ()) -> Union["pyrogram.Message", None]:
|
||||
def send_animation(
|
||||
self,
|
||||
chat_id: Union[int, str],
|
||||
animation: str,
|
||||
caption: str = "",
|
||||
parse_mode: str = "",
|
||||
duration: int = 0,
|
||||
width: int = 0,
|
||||
height: int = 0,
|
||||
thumb: str = None,
|
||||
disable_notification: bool = None,
|
||||
reply_to_message_id: int = None,
|
||||
reply_markup: Union[
|
||||
"pyrogram.InlineKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardRemove",
|
||||
"pyrogram.ForceReply"
|
||||
] = None,
|
||||
progress: callable = None,
|
||||
progress_args: tuple = ()
|
||||
) -> Union["pyrogram.Message", None]:
|
||||
"""Use this method to send animation files (animation or H.264/MPEG-4 AVC video without sound).
|
||||
|
||||
Args:
|
||||
|
@ -28,23 +28,27 @@ from pyrogram.client.ext import BaseClient, utils
|
||||
|
||||
|
||||
class SendAudio(BaseClient):
|
||||
def send_audio(self,
|
||||
chat_id: Union[int, str],
|
||||
audio: str,
|
||||
caption: str = "",
|
||||
parse_mode: str = "",
|
||||
duration: int = 0,
|
||||
performer: str = None,
|
||||
title: str = None,
|
||||
thumb: str = None,
|
||||
disable_notification: bool = None,
|
||||
reply_to_message_id: int = None,
|
||||
reply_markup: Union["pyrogram.InlineKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardRemove",
|
||||
"pyrogram.ForceReply"] = None,
|
||||
progress: callable = None,
|
||||
progress_args: tuple = ()) -> Union["pyrogram.Message", None]:
|
||||
def send_audio(
|
||||
self,
|
||||
chat_id: Union[int, str],
|
||||
audio: str,
|
||||
caption: str = "",
|
||||
parse_mode: str = "",
|
||||
duration: int = 0,
|
||||
performer: str = None,
|
||||
title: str = None,
|
||||
thumb: str = None,
|
||||
disable_notification: bool = None,
|
||||
reply_to_message_id: int = None,
|
||||
reply_markup: Union[
|
||||
"pyrogram.InlineKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardRemove",
|
||||
"pyrogram.ForceReply"
|
||||
] = None,
|
||||
progress: callable = None,
|
||||
progress_args: tuple = ()
|
||||
) -> Union["pyrogram.Message", None]:
|
||||
"""Use this method to send audio files.
|
||||
|
||||
For sending voice messages, use the :obj:`send_voice()` method instead.
|
||||
|
@ -23,10 +23,12 @@ from pyrogram.client.ext import BaseClient, ChatAction
|
||||
|
||||
|
||||
class SendChatAction(BaseClient):
|
||||
def send_chat_action(self,
|
||||
chat_id: Union[int, str],
|
||||
action: Union[ChatAction, str],
|
||||
progress: int = 0):
|
||||
def send_chat_action(
|
||||
self,
|
||||
chat_id: Union[int, str],
|
||||
action: Union[ChatAction, str],
|
||||
progress: int = 0
|
||||
):
|
||||
"""Use this method when you need to tell the other party that something is happening on your side.
|
||||
|
||||
Args:
|
||||
|
@ -24,18 +24,22 @@ from pyrogram.client.ext import BaseClient
|
||||
|
||||
|
||||
class SendContact(BaseClient):
|
||||
def send_contact(self,
|
||||
chat_id: Union[int, str],
|
||||
phone_number: str,
|
||||
first_name: str,
|
||||
last_name: str = "",
|
||||
vcard: str = "",
|
||||
disable_notification: bool = None,
|
||||
reply_to_message_id: int = None,
|
||||
reply_markup: Union["pyrogram.InlineKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardRemove",
|
||||
"pyrogram.ForceReply"] = None) -> "pyrogram.Message":
|
||||
def send_contact(
|
||||
self,
|
||||
chat_id: Union[int, str],
|
||||
phone_number: str,
|
||||
first_name: str,
|
||||
last_name: str = "",
|
||||
vcard: str = "",
|
||||
disable_notification: bool = None,
|
||||
reply_to_message_id: int = None,
|
||||
reply_markup: Union[
|
||||
"pyrogram.InlineKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardRemove",
|
||||
"pyrogram.ForceReply"
|
||||
] = None
|
||||
) -> "pyrogram.Message":
|
||||
"""Use this method to send phone contacts.
|
||||
|
||||
Args:
|
||||
|
@ -28,20 +28,24 @@ from pyrogram.client.ext import BaseClient, utils
|
||||
|
||||
|
||||
class SendDocument(BaseClient):
|
||||
def send_document(self,
|
||||
chat_id: Union[int, str],
|
||||
document: str,
|
||||
thumb: str = None,
|
||||
caption: str = "",
|
||||
parse_mode: str = "",
|
||||
disable_notification: bool = None,
|
||||
reply_to_message_id: int = None,
|
||||
reply_markup: Union["pyrogram.InlineKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardRemove",
|
||||
"pyrogram.ForceReply"] = None,
|
||||
progress: callable = None,
|
||||
progress_args: tuple = ()) -> Union["pyrogram.Message", None]:
|
||||
def send_document(
|
||||
self,
|
||||
chat_id: Union[int, str],
|
||||
document: str,
|
||||
thumb: str = None,
|
||||
caption: str = "",
|
||||
parse_mode: str = "",
|
||||
disable_notification: bool = None,
|
||||
reply_to_message_id: int = None,
|
||||
reply_markup: Union[
|
||||
"pyrogram.InlineKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardRemove",
|
||||
"pyrogram.ForceReply"
|
||||
] = None,
|
||||
progress: callable = None,
|
||||
progress_args: tuple = ()
|
||||
) -> Union["pyrogram.Message", None]:
|
||||
"""Use this method to send general files.
|
||||
|
||||
Args:
|
||||
|
@ -24,16 +24,20 @@ from pyrogram.client.ext import BaseClient
|
||||
|
||||
|
||||
class SendLocation(BaseClient):
|
||||
def send_location(self,
|
||||
chat_id: Union[int, str],
|
||||
latitude: float,
|
||||
longitude: float,
|
||||
disable_notification: bool = None,
|
||||
reply_to_message_id: int = None,
|
||||
reply_markup: Union["pyrogram.InlineKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardRemove",
|
||||
"pyrogram.ForceReply"] = None) -> "pyrogram.Message":
|
||||
def send_location(
|
||||
self,
|
||||
chat_id: Union[int, str],
|
||||
latitude: float,
|
||||
longitude: float,
|
||||
disable_notification: bool = None,
|
||||
reply_to_message_id: int = None,
|
||||
reply_markup: Union[
|
||||
"pyrogram.InlineKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardRemove",
|
||||
"pyrogram.ForceReply"
|
||||
] = None
|
||||
) -> "pyrogram.Message":
|
||||
"""Use this method to send points on the map.
|
||||
|
||||
Args:
|
||||
|
@ -34,11 +34,13 @@ log = logging.getLogger(__name__)
|
||||
class SendMediaGroup(BaseClient):
|
||||
# TODO: Add progress parameter
|
||||
# TODO: Figure out how to send albums using URLs
|
||||
def send_media_group(self,
|
||||
chat_id: Union[int, str],
|
||||
media: List[Union["pyrogram.InputMediaPhoto", "pyrogram.InputMediaVideo"]],
|
||||
disable_notification: bool = None,
|
||||
reply_to_message_id: int = None):
|
||||
def send_media_group(
|
||||
self,
|
||||
chat_id: Union[int, str],
|
||||
media: List[Union["pyrogram.InputMediaPhoto", "pyrogram.InputMediaVideo"]],
|
||||
disable_notification: bool = None,
|
||||
reply_to_message_id: int = None
|
||||
):
|
||||
"""Use this method to send a group of photos or videos as an album.
|
||||
|
||||
Args:
|
||||
|
@ -24,17 +24,21 @@ from ...ext import BaseClient
|
||||
|
||||
|
||||
class SendMessage(BaseClient):
|
||||
def send_message(self,
|
||||
chat_id: Union[int, str],
|
||||
text: str,
|
||||
parse_mode: str = "",
|
||||
disable_web_page_preview: bool = None,
|
||||
disable_notification: bool = None,
|
||||
reply_to_message_id: int = None,
|
||||
reply_markup: Union["pyrogram.InlineKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardRemove",
|
||||
"pyrogram.ForceReply"] = None) -> "pyrogram.Message":
|
||||
def send_message(
|
||||
self,
|
||||
chat_id: Union[int, str],
|
||||
text: str,
|
||||
parse_mode: str = "",
|
||||
disable_web_page_preview: bool = None,
|
||||
disable_notification: bool = None,
|
||||
reply_to_message_id: int = None,
|
||||
reply_markup: Union[
|
||||
"pyrogram.InlineKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardRemove",
|
||||
"pyrogram.ForceReply"
|
||||
] = None
|
||||
) -> "pyrogram.Message":
|
||||
"""Use this method to send text messages.
|
||||
|
||||
Args:
|
||||
|
@ -28,20 +28,24 @@ from pyrogram.client.ext import BaseClient, utils
|
||||
|
||||
|
||||
class SendPhoto(BaseClient):
|
||||
def send_photo(self,
|
||||
chat_id: Union[int, str],
|
||||
photo: str,
|
||||
caption: str = "",
|
||||
parse_mode: str = "",
|
||||
ttl_seconds: int = None,
|
||||
disable_notification: bool = None,
|
||||
reply_to_message_id: int = None,
|
||||
reply_markup: Union["pyrogram.InlineKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardRemove",
|
||||
"pyrogram.ForceReply"] = None,
|
||||
progress: callable = None,
|
||||
progress_args: tuple = ()) -> Union["pyrogram.Message", None]:
|
||||
def send_photo(
|
||||
self,
|
||||
chat_id: Union[int, str],
|
||||
photo: str,
|
||||
caption: str = "",
|
||||
parse_mode: str = "",
|
||||
ttl_seconds: int = None,
|
||||
disable_notification: bool = None,
|
||||
reply_to_message_id: int = None,
|
||||
reply_markup: Union[
|
||||
"pyrogram.InlineKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardRemove",
|
||||
"pyrogram.ForceReply"
|
||||
] = None,
|
||||
progress: callable = None,
|
||||
progress_args: tuple = ()
|
||||
) -> Union["pyrogram.Message", None]:
|
||||
"""Use this method to send photos.
|
||||
|
||||
Args:
|
||||
|
@ -24,16 +24,20 @@ from pyrogram.client.ext import BaseClient
|
||||
|
||||
|
||||
class SendPoll(BaseClient):
|
||||
def send_poll(self,
|
||||
chat_id: Union[int, str],
|
||||
question: str,
|
||||
options: List[str],
|
||||
disable_notification: bool = None,
|
||||
reply_to_message_id: int = None,
|
||||
reply_markup: Union["pyrogram.InlineKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardRemove",
|
||||
"pyrogram.ForceReply"] = None) -> "pyrogram.Message":
|
||||
def send_poll \
|
||||
(self,
|
||||
chat_id: Union[int, str],
|
||||
question: str,
|
||||
options: List[str],
|
||||
disable_notification: bool = None,
|
||||
reply_to_message_id: int = None,
|
||||
reply_markup: Union[
|
||||
"pyrogram.InlineKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardRemove",
|
||||
"pyrogram.ForceReply"
|
||||
] = None
|
||||
) -> "pyrogram.Message":
|
||||
"""Use this method to send a new poll.
|
||||
|
||||
Args:
|
||||
|
@ -28,17 +28,21 @@ from pyrogram.client.ext import BaseClient, utils
|
||||
|
||||
|
||||
class SendSticker(BaseClient):
|
||||
def send_sticker(self,
|
||||
chat_id: Union[int, str],
|
||||
sticker: str,
|
||||
disable_notification: bool = None,
|
||||
reply_to_message_id: int = None,
|
||||
reply_markup: Union["pyrogram.InlineKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardRemove",
|
||||
"pyrogram.ForceReply"] = None,
|
||||
progress: callable = None,
|
||||
progress_args: tuple = ()) -> Union["pyrogram.Message", None]:
|
||||
def send_sticker(
|
||||
self,
|
||||
chat_id: Union[int, str],
|
||||
sticker: str,
|
||||
disable_notification: bool = None,
|
||||
reply_to_message_id: int = None,
|
||||
reply_markup: Union[
|
||||
"pyrogram.InlineKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardRemove",
|
||||
"pyrogram.ForceReply"
|
||||
] = None,
|
||||
progress: callable = None,
|
||||
progress_args: tuple = ()
|
||||
) -> Union["pyrogram.Message", None]:
|
||||
"""Use this method to send .webp stickers.
|
||||
|
||||
Args:
|
||||
|
@ -24,20 +24,24 @@ from pyrogram.client.ext import BaseClient
|
||||
|
||||
|
||||
class SendVenue(BaseClient):
|
||||
def send_venue(self,
|
||||
chat_id: Union[int, str],
|
||||
latitude: float,
|
||||
longitude: float,
|
||||
title: str,
|
||||
address: str,
|
||||
foursquare_id: str = "",
|
||||
foursquare_type: str = "",
|
||||
disable_notification: bool = None,
|
||||
reply_to_message_id: int = None,
|
||||
reply_markup: Union["pyrogram.InlineKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardRemove",
|
||||
"pyrogram.ForceReply"] = None) -> "pyrogram.Message":
|
||||
def send_venue(
|
||||
self,
|
||||
chat_id: Union[int, str],
|
||||
latitude: float,
|
||||
longitude: float,
|
||||
title: str,
|
||||
address: str,
|
||||
foursquare_id: str = "",
|
||||
foursquare_type: str = "",
|
||||
disable_notification: bool = None,
|
||||
reply_to_message_id: int = None,
|
||||
reply_markup: Union[
|
||||
"pyrogram.InlineKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardRemove",
|
||||
"pyrogram.ForceReply"
|
||||
] = None
|
||||
) -> "pyrogram.Message":
|
||||
"""Use this method to send information about a venue.
|
||||
|
||||
Args:
|
||||
|
@ -28,24 +28,28 @@ from pyrogram.client.ext import BaseClient, utils
|
||||
|
||||
|
||||
class SendVideo(BaseClient):
|
||||
def send_video(self,
|
||||
chat_id: Union[int, str],
|
||||
video: str,
|
||||
caption: str = "",
|
||||
parse_mode: str = "",
|
||||
duration: int = 0,
|
||||
width: int = 0,
|
||||
height: int = 0,
|
||||
thumb: str = None,
|
||||
supports_streaming: bool = True,
|
||||
disable_notification: bool = None,
|
||||
reply_to_message_id: int = None,
|
||||
reply_markup: Union["pyrogram.InlineKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardRemove",
|
||||
"pyrogram.ForceReply"] = None,
|
||||
progress: callable = None,
|
||||
progress_args: tuple = ()) -> Union["pyrogram.Message", None]:
|
||||
def send_video(
|
||||
self,
|
||||
chat_id: Union[int, str],
|
||||
video: str,
|
||||
caption: str = "",
|
||||
parse_mode: str = "",
|
||||
duration: int = 0,
|
||||
width: int = 0,
|
||||
height: int = 0,
|
||||
thumb: str = None,
|
||||
supports_streaming: bool = True,
|
||||
disable_notification: bool = None,
|
||||
reply_to_message_id: int = None,
|
||||
reply_markup: Union[
|
||||
"pyrogram.InlineKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardRemove",
|
||||
"pyrogram.ForceReply"
|
||||
] = None,
|
||||
progress: callable = None,
|
||||
progress_args: tuple = ()
|
||||
) -> Union["pyrogram.Message", None]:
|
||||
"""Use this method to send video files.
|
||||
|
||||
Args:
|
||||
|
@ -28,20 +28,24 @@ from pyrogram.client.ext import BaseClient, utils
|
||||
|
||||
|
||||
class SendVideoNote(BaseClient):
|
||||
def send_video_note(self,
|
||||
chat_id: Union[int, str],
|
||||
video_note: str,
|
||||
duration: int = 0,
|
||||
length: int = 1,
|
||||
thumb: str = None,
|
||||
disable_notification: bool = None,
|
||||
reply_to_message_id: int = None,
|
||||
reply_markup: Union["pyrogram.InlineKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardRemove",
|
||||
"pyrogram.ForceReply"] = None,
|
||||
progress: callable = None,
|
||||
progress_args: tuple = ()) -> Union["pyrogram.Message", None]:
|
||||
def send_video_note(
|
||||
self,
|
||||
chat_id: Union[int, str],
|
||||
video_note: str,
|
||||
duration: int = 0,
|
||||
length: int = 1,
|
||||
thumb: str = None,
|
||||
disable_notification: bool = None,
|
||||
reply_to_message_id: int = None,
|
||||
reply_markup: Union[
|
||||
"pyrogram.InlineKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardRemove",
|
||||
"pyrogram.ForceReply"
|
||||
] = None,
|
||||
progress: callable = None,
|
||||
progress_args: tuple = ()
|
||||
) -> Union["pyrogram.Message", None]:
|
||||
"""Use this method to send video messages.
|
||||
|
||||
Args:
|
||||
|
@ -28,20 +28,24 @@ from pyrogram.client.ext import BaseClient, utils
|
||||
|
||||
|
||||
class SendVoice(BaseClient):
|
||||
def send_voice(self,
|
||||
chat_id: Union[int, str],
|
||||
voice: str,
|
||||
caption: str = "",
|
||||
parse_mode: str = "",
|
||||
duration: int = 0,
|
||||
disable_notification: bool = None,
|
||||
reply_to_message_id: int = None,
|
||||
reply_markup: Union["pyrogram.InlineKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardRemove",
|
||||
"pyrogram.ForceReply"] = None,
|
||||
progress: callable = None,
|
||||
progress_args: tuple = ()) -> Union["pyrogram.Message", None]:
|
||||
def send_voice(
|
||||
self,
|
||||
chat_id: Union[int, str],
|
||||
voice: str,
|
||||
caption: str = "",
|
||||
parse_mode: str = "",
|
||||
duration: int = 0,
|
||||
disable_notification: bool = None,
|
||||
reply_to_message_id: int = None,
|
||||
reply_markup: Union[
|
||||
"pyrogram.InlineKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardRemove",
|
||||
"pyrogram.ForceReply"
|
||||
] = None,
|
||||
progress: callable = None,
|
||||
progress_args: tuple = ()
|
||||
) -> Union["pyrogram.Message", None]:
|
||||
"""Use this method to send audio files.
|
||||
|
||||
Args:
|
||||
|
@ -23,10 +23,12 @@ from pyrogram.client.ext import BaseClient
|
||||
|
||||
|
||||
class VotePoll(BaseClient):
|
||||
def vote_poll(self,
|
||||
chat_id: Union[int, str],
|
||||
message_id: id,
|
||||
option: int) -> bool:
|
||||
def vote_poll(
|
||||
self,
|
||||
chat_id: Union[int, str],
|
||||
message_id: id,
|
||||
option: int
|
||||
) -> bool:
|
||||
"""Use this method to vote a poll.
|
||||
|
||||
Args:
|
||||
|
@ -24,10 +24,12 @@ from ...ext import BaseClient
|
||||
|
||||
|
||||
class ChangeCloudPassword(BaseClient):
|
||||
def change_cloud_password(self,
|
||||
current_password: str,
|
||||
new_password: str,
|
||||
new_hint: str = "") -> bool:
|
||||
def change_cloud_password(
|
||||
self,
|
||||
current_password: str,
|
||||
new_password: str,
|
||||
new_hint: str = ""
|
||||
) -> bool:
|
||||
"""Use this method to change your Two-Step Verification password (Cloud Password) with a new one.
|
||||
|
||||
Args:
|
||||
|
@ -24,10 +24,12 @@ from ...ext import BaseClient
|
||||
|
||||
|
||||
class EnableCloudPassword(BaseClient):
|
||||
def enable_cloud_password(self,
|
||||
password: str,
|
||||
hint: str = "",
|
||||
email: str = None) -> bool:
|
||||
def enable_cloud_password(
|
||||
self,
|
||||
password: str,
|
||||
hint: str = "",
|
||||
email: str = None
|
||||
) -> bool:
|
||||
"""Use this method to enable the Two-Step Verification security feature (Cloud Password) on your account.
|
||||
|
||||
This password will be asked when you log-in on a new device in addition to the SMS code.
|
||||
|
@ -22,8 +22,10 @@ from ...ext import BaseClient
|
||||
|
||||
|
||||
class RemoveCloudPassword(BaseClient):
|
||||
def remove_cloud_password(self,
|
||||
password: str) -> bool:
|
||||
def remove_cloud_password(
|
||||
self,
|
||||
password: str
|
||||
) -> bool:
|
||||
"""Use this method to turn off the Two-Step Verification security feature (Cloud Password) on your account.
|
||||
|
||||
Args:
|
||||
|
@ -25,8 +25,10 @@ from ...ext import BaseClient
|
||||
|
||||
|
||||
class DeleteUserProfilePhotos(BaseClient):
|
||||
def delete_user_profile_photos(self,
|
||||
id: Union[str, List[str]]) -> bool:
|
||||
def delete_user_profile_photos(
|
||||
self,
|
||||
id: Union[str, List[str]]
|
||||
) -> bool:
|
||||
"""Use this method to delete your own profile photos
|
||||
|
||||
Args:
|
||||
|
@ -24,10 +24,12 @@ from ...ext import BaseClient
|
||||
|
||||
|
||||
class GetUserProfilePhotos(BaseClient):
|
||||
def get_user_profile_photos(self,
|
||||
user_id: Union[int, str],
|
||||
offset: int = 0,
|
||||
limit: int = 100) -> "pyrogram.UserProfilePhotos":
|
||||
def get_user_profile_photos(
|
||||
self,
|
||||
user_id: Union[int, str],
|
||||
offset: int = 0,
|
||||
limit: int = 100
|
||||
) -> "pyrogram.UserProfilePhotos":
|
||||
"""Use this method to get a list of profile pictures for a user.
|
||||
|
||||
Args:
|
||||
|
@ -24,8 +24,10 @@ from ...ext import BaseClient
|
||||
|
||||
|
||||
class GetUsers(BaseClient):
|
||||
def get_users(self,
|
||||
user_ids: Iterable[Union[int, str]]) -> Union["pyrogram.User", List["pyrogram.User"]]:
|
||||
def get_users(
|
||||
self,
|
||||
user_ids: Iterable[Union[int, str]]
|
||||
) -> Union["pyrogram.User", List["pyrogram.User"]]:
|
||||
"""Use this method to get information about a user.
|
||||
You can retrieve up to 200 users at once.
|
||||
|
||||
|
@ -21,8 +21,10 @@ from ...ext import BaseClient
|
||||
|
||||
|
||||
class SetUserProfilePhoto(BaseClient):
|
||||
def set_user_profile_photo(self,
|
||||
photo: str) -> bool:
|
||||
def set_user_profile_photo(
|
||||
self,
|
||||
photo: str
|
||||
) -> bool:
|
||||
"""Use this method to set a new profile photo.
|
||||
|
||||
This method only works for Users.
|
||||
|
@ -23,8 +23,10 @@ from ...ext import BaseClient
|
||||
|
||||
|
||||
class UpdateUsername(BaseClient):
|
||||
def update_username(self,
|
||||
username: Union[str, None]) -> bool:
|
||||
def update_username(
|
||||
self,
|
||||
username: Union[str, None]
|
||||
) -> bool:
|
||||
"""Use this method to update your own username.
|
||||
|
||||
This method only works for users, not bots. Bot usernames must be changed via Bot Support or by recreating
|
||||
|
@ -61,16 +61,16 @@ class CallbackQuery(PyrogramType, Update):
|
||||
__slots__ = ["id", "from_user", "chat_instance", "message", "inline_message_id", "data", "game_short_name"]
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
client: "pyrogram.client.ext.BaseClient",
|
||||
id: str,
|
||||
from_user: User,
|
||||
chat_instance: str,
|
||||
message: "pyrogram.Message" = None,
|
||||
inline_message_id: str = None,
|
||||
data: bytes = None,
|
||||
game_short_name: str = None
|
||||
self,
|
||||
*,
|
||||
client: "pyrogram.client.ext.BaseClient",
|
||||
id: str,
|
||||
from_user: User,
|
||||
chat_instance: str,
|
||||
message: "pyrogram.Message" = None,
|
||||
inline_message_id: str = None,
|
||||
data: bytes = None,
|
||||
game_short_name: str = None
|
||||
):
|
||||
super().__init__(client)
|
||||
|
||||
|
@ -36,8 +36,8 @@ class ForceReply(PyrogramType):
|
||||
__slots__ = ["selective"]
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
selective: bool = None
|
||||
self,
|
||||
selective: bool = None
|
||||
):
|
||||
super().__init__(None)
|
||||
|
||||
|
@ -40,12 +40,12 @@ class GameHighScore(PyrogramType):
|
||||
__slots__ = ["user", "score", "position"]
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
client: "pyrogram.client.ext.BaseClient",
|
||||
user: User,
|
||||
score: int,
|
||||
position: int = None
|
||||
self,
|
||||
*,
|
||||
client: "pyrogram.client.ext.BaseClient",
|
||||
user: User,
|
||||
score: int,
|
||||
position: int = None
|
||||
):
|
||||
super().__init__(client)
|
||||
|
||||
|
@ -38,11 +38,11 @@ class GameHighScores(PyrogramType):
|
||||
__slots__ = ["total_count", "game_high_scores"]
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
client: "pyrogram.client.ext.BaseClient",
|
||||
total_count: int,
|
||||
game_high_scores: List[GameHighScore]
|
||||
self,
|
||||
*,
|
||||
client: "pyrogram.client.ext.BaseClient",
|
||||
total_count: int,
|
||||
game_high_scores: List[GameHighScore]
|
||||
):
|
||||
super().__init__(client)
|
||||
|
||||
|
@ -59,13 +59,13 @@ class InlineKeyboardButton(PyrogramType):
|
||||
]
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
text: str,
|
||||
callback_data: bytes = None,
|
||||
url: str = None,
|
||||
switch_inline_query: str = None,
|
||||
switch_inline_query_current_chat: str = None,
|
||||
callback_game: CallbackGame = None
|
||||
self,
|
||||
text: str,
|
||||
callback_data: bytes = None,
|
||||
url: str = None,
|
||||
switch_inline_query: str = None,
|
||||
switch_inline_query_current_chat: str = None,
|
||||
callback_game: CallbackGame = None
|
||||
):
|
||||
super().__init__(None)
|
||||
|
||||
|
@ -34,8 +34,8 @@ class InlineKeyboardMarkup(PyrogramType):
|
||||
__slots__ = ["inline_keyboard"]
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
inline_keyboard: List[List[InlineKeyboardButton]]
|
||||
self,
|
||||
inline_keyboard: List[List[InlineKeyboardButton]]
|
||||
):
|
||||
super().__init__(None)
|
||||
|
||||
|
@ -43,10 +43,10 @@ class KeyboardButton(PyrogramType):
|
||||
__slots__ = ["text", "request_contact", "request_location"]
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
text: str,
|
||||
request_contact: bool = None,
|
||||
request_location: bool = None
|
||||
self,
|
||||
text: str,
|
||||
request_contact: bool = None,
|
||||
request_location: bool = None
|
||||
):
|
||||
super().__init__(None)
|
||||
|
||||
|
@ -52,11 +52,11 @@ class ReplyKeyboardMarkup(PyrogramType):
|
||||
__slots__ = ["keyboard", "resize_keyboard", "one_time_keyboard", "selective"]
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
keyboard: List[List[Union[KeyboardButton, str]]],
|
||||
resize_keyboard: bool = None,
|
||||
one_time_keyboard: bool = None,
|
||||
selective: bool = None
|
||||
self,
|
||||
keyboard: List[List[Union[KeyboardButton, str]]],
|
||||
resize_keyboard: bool = None,
|
||||
one_time_keyboard: bool = None,
|
||||
selective: bool = None
|
||||
):
|
||||
super().__init__(None)
|
||||
|
||||
|
@ -38,8 +38,8 @@ class ReplyKeyboardRemove(PyrogramType):
|
||||
__slots__ = ["selective"]
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
selective: bool = None
|
||||
self,
|
||||
selective: bool = None
|
||||
):
|
||||
super().__init__(None)
|
||||
|
||||
|
@ -21,10 +21,10 @@ class InputMedia:
|
||||
__slots__ = ["media", "caption", "parse_mode"]
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
media: str,
|
||||
caption: str,
|
||||
parse_mode: str
|
||||
self,
|
||||
media: str,
|
||||
caption: str,
|
||||
parse_mode: str
|
||||
):
|
||||
self.media = media
|
||||
self.caption = caption
|
||||
|
@ -55,14 +55,14 @@ class InputMediaAnimation(InputMedia):
|
||||
__slots__ = ["thumb", "width", "height", "duration"]
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
media: str,
|
||||
thumb: str = None,
|
||||
caption: str = "",
|
||||
parse_mode: str = "",
|
||||
width: int = 0,
|
||||
height: int = 0,
|
||||
duration: int = 0
|
||||
self,
|
||||
media: str,
|
||||
thumb: str = None,
|
||||
caption: str = "",
|
||||
parse_mode: str = "",
|
||||
width: int = 0,
|
||||
height: int = 0,
|
||||
duration: int = 0
|
||||
):
|
||||
super().__init__(media, caption, parse_mode)
|
||||
|
||||
|
@ -56,14 +56,14 @@ class InputMediaAudio(InputMedia):
|
||||
__slots__ = ["thumb", "duration", "performer", "title"]
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
media: str,
|
||||
thumb: str = None,
|
||||
caption: str = "",
|
||||
parse_mode: str = "",
|
||||
duration: int = 0,
|
||||
performer: int = "",
|
||||
title: str = ""
|
||||
self,
|
||||
media: str,
|
||||
thumb: str = None,
|
||||
caption: str = "",
|
||||
parse_mode: str = "",
|
||||
duration: int = 0,
|
||||
performer: int = "",
|
||||
title: str = ""
|
||||
):
|
||||
super().__init__(media, caption, parse_mode)
|
||||
|
||||
|
@ -46,11 +46,11 @@ class InputMediaDocument(InputMedia):
|
||||
__slots__ = ["thumb"]
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
media: str,
|
||||
thumb: str = None,
|
||||
caption: str = "",
|
||||
parse_mode: str = ""
|
||||
self,
|
||||
media: str,
|
||||
thumb: str = None,
|
||||
caption: str = "",
|
||||
parse_mode: str = ""
|
||||
):
|
||||
super().__init__(media, caption, parse_mode)
|
||||
|
||||
|
@ -42,9 +42,9 @@ class InputMediaPhoto(InputMedia):
|
||||
__slots__ = []
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
media: str,
|
||||
caption: str = "",
|
||||
parse_mode: str = ""
|
||||
self,
|
||||
media: str,
|
||||
caption: str = "",
|
||||
parse_mode: str = ""
|
||||
):
|
||||
super().__init__(media, caption, parse_mode)
|
||||
|
@ -60,15 +60,15 @@ class InputMediaVideo(InputMedia):
|
||||
__slots__ = ["thumb", "width", "height", "duration", "supports_streaming"]
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
media: str,
|
||||
thumb: str = None,
|
||||
caption: str = "",
|
||||
parse_mode: str = "",
|
||||
width: int = 0,
|
||||
height: int = 0,
|
||||
duration: int = 0,
|
||||
supports_streaming: bool = True
|
||||
self,
|
||||
media: str,
|
||||
thumb: str = None,
|
||||
caption: str = "",
|
||||
parse_mode: str = "",
|
||||
width: int = 0,
|
||||
height: int = 0,
|
||||
duration: int = 0,
|
||||
supports_streaming: bool = True
|
||||
):
|
||||
super().__init__(media, caption, parse_mode)
|
||||
|
||||
|
@ -38,10 +38,10 @@ class InputPhoneContact:
|
||||
__slots__ = []
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
phone: str,
|
||||
first_name: str,
|
||||
last_name: str = ""
|
||||
self,
|
||||
phone: str,
|
||||
first_name: str,
|
||||
last_name: str = ""
|
||||
):
|
||||
pass
|
||||
|
||||
|
@ -60,18 +60,18 @@ class Animation(PyrogramType):
|
||||
__slots__ = ["file_id", "thumb", "file_name", "mime_type", "file_size", "date", "width", "height", "duration"]
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
client: "pyrogram.client.ext.BaseClient",
|
||||
file_id: str,
|
||||
width: int,
|
||||
height: int,
|
||||
duration: int,
|
||||
thumb: PhotoSize = None,
|
||||
file_name: str = None,
|
||||
mime_type: str = None,
|
||||
file_size: int = None,
|
||||
date: int = None
|
||||
self,
|
||||
*,
|
||||
client: "pyrogram.client.ext.BaseClient",
|
||||
file_id: str,
|
||||
width: int,
|
||||
height: int,
|
||||
duration: int,
|
||||
thumb: PhotoSize = None,
|
||||
file_name: str = None,
|
||||
mime_type: str = None,
|
||||
file_size: int = None,
|
||||
date: int = None
|
||||
):
|
||||
super().__init__(client)
|
||||
|
||||
|
@ -60,18 +60,18 @@ class Audio(PyrogramType):
|
||||
__slots__ = ["file_id", "thumb", "file_name", "mime_type", "file_size", "date", "duration", "performer", "title"]
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
client: "pyrogram.client.ext.BaseClient",
|
||||
file_id: str,
|
||||
duration: int,
|
||||
thumb: PhotoSize = None,
|
||||
file_name: str = None,
|
||||
mime_type: str = None,
|
||||
file_size: int = None,
|
||||
date: int = None,
|
||||
performer: str = None,
|
||||
title: str = None
|
||||
self,
|
||||
*,
|
||||
client: "pyrogram.client.ext.BaseClient",
|
||||
file_id: str,
|
||||
duration: int,
|
||||
thumb: PhotoSize = None,
|
||||
file_name: str = None,
|
||||
mime_type: str = None,
|
||||
file_size: int = None,
|
||||
date: int = None,
|
||||
performer: str = None,
|
||||
title: str = None
|
||||
):
|
||||
super().__init__(client)
|
||||
|
||||
|
@ -45,14 +45,14 @@ class Contact(PyrogramType):
|
||||
__slots__ = ["phone_number", "first_name", "last_name", "user_id", "vcard"]
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
client: "pyrogram.client.ext.BaseClient",
|
||||
phone_number: str,
|
||||
first_name: str,
|
||||
last_name: str = None,
|
||||
user_id: int = None,
|
||||
vcard: str = None
|
||||
self,
|
||||
*,
|
||||
client: "pyrogram.client.ext.BaseClient",
|
||||
phone_number: str,
|
||||
first_name: str,
|
||||
last_name: str = None,
|
||||
user_id: int = None,
|
||||
vcard: str = None
|
||||
):
|
||||
super().__init__(client)
|
||||
|
||||
|
@ -51,15 +51,15 @@ class Document(PyrogramType):
|
||||
__slots__ = ["file_id", "thumb", "file_name", "mime_type", "file_size", "date"]
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
client: "pyrogram.client.ext.BaseClient",
|
||||
file_id: str,
|
||||
thumb: PhotoSize = None,
|
||||
file_name: str = None,
|
||||
mime_type: str = None,
|
||||
file_size: int = None,
|
||||
date: int = None
|
||||
self,
|
||||
*,
|
||||
client: "pyrogram.client.ext.BaseClient",
|
||||
file_id: str,
|
||||
thumb: PhotoSize = None,
|
||||
file_name: str = None,
|
||||
mime_type: str = None,
|
||||
file_size: int = None,
|
||||
date: int = None
|
||||
):
|
||||
super().__init__(client)
|
||||
|
||||
|
@ -51,15 +51,15 @@ class Game(PyrogramType):
|
||||
__slots__ = ["id", "title", "short_name", "description", "photo", "animation"]
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
client: "pyrogram.client.ext.BaseClient",
|
||||
id: int,
|
||||
title: str,
|
||||
short_name: str,
|
||||
description: str,
|
||||
photo: Photo,
|
||||
animation: Animation = None
|
||||
self,
|
||||
*,
|
||||
client: "pyrogram.client.ext.BaseClient",
|
||||
id: int,
|
||||
title: str,
|
||||
short_name: str,
|
||||
description: str,
|
||||
photo: Photo,
|
||||
animation: Animation = None
|
||||
):
|
||||
super().__init__(client)
|
||||
|
||||
|
@ -36,11 +36,11 @@ class Location(PyrogramType):
|
||||
__slots__ = ["longitude", "latitude"]
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
client: "pyrogram.client.ext.BaseClient",
|
||||
longitude: float,
|
||||
latitude: float
|
||||
self,
|
||||
*,
|
||||
client: "pyrogram.client.ext.BaseClient",
|
||||
longitude: float,
|
||||
latitude: float
|
||||
):
|
||||
super().__init__(client)
|
||||
|
||||
|
@ -246,67 +246,67 @@ class Message(PyrogramType, Update):
|
||||
]
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
client: "pyrogram.client.ext.BaseClient",
|
||||
message_id: int,
|
||||
date: int = None,
|
||||
chat: Chat = None,
|
||||
from_user: User = None,
|
||||
forward_from: User = None,
|
||||
forward_from_chat: Chat = None,
|
||||
forward_from_message_id: int = None,
|
||||
forward_signature: str = None,
|
||||
forward_date: int = None,
|
||||
reply_to_message: "Message" = None,
|
||||
mentioned: bool = None,
|
||||
empty: bool = None,
|
||||
service: bool = None,
|
||||
media: bool = None,
|
||||
edit_date: int = None,
|
||||
media_group_id: str = None,
|
||||
author_signature: str = None,
|
||||
text: str = None,
|
||||
entities: List["pyrogram.MessageEntity"] = None,
|
||||
caption_entities: List["pyrogram.MessageEntity"] = None,
|
||||
audio: "pyrogram.Audio" = None,
|
||||
document: "pyrogram.Document" = None,
|
||||
photo: "pyrogram.Photo" = None,
|
||||
sticker: "pyrogram.Sticker" = None,
|
||||
animation: "pyrogram.Animation" = None,
|
||||
game: "pyrogram.Game" = None,
|
||||
video: "pyrogram.Video" = None,
|
||||
voice: "pyrogram.Voice" = None,
|
||||
video_note: "pyrogram.VideoNote" = None,
|
||||
caption: str = None,
|
||||
contact: "pyrogram.Contact" = None,
|
||||
location: "pyrogram.Location" = None,
|
||||
venue: "pyrogram.Venue" = None,
|
||||
web_page: bool = None,
|
||||
poll: "pyrogram.Poll" = None,
|
||||
new_chat_members: List[User] = None,
|
||||
left_chat_member: User = None,
|
||||
new_chat_title: str = None,
|
||||
new_chat_photo: "pyrogram.Photo" = None,
|
||||
delete_chat_photo: bool = None,
|
||||
group_chat_created: bool = None,
|
||||
supergroup_chat_created: bool = None,
|
||||
channel_chat_created: bool = None,
|
||||
migrate_to_chat_id: int = None,
|
||||
migrate_from_chat_id: int = None,
|
||||
pinned_message: "Message" = None,
|
||||
game_high_score: int = None,
|
||||
views: int = None,
|
||||
via_bot: User = None,
|
||||
outgoing: bool = None,
|
||||
matches: List[Match] = None,
|
||||
command: List[str] = None,
|
||||
reply_markup: Union[
|
||||
"pyrogram.InlineKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardRemove",
|
||||
"pyrogram.ForceReply"
|
||||
] = None
|
||||
self,
|
||||
*,
|
||||
client: "pyrogram.client.ext.BaseClient",
|
||||
message_id: int,
|
||||
date: int = None,
|
||||
chat: Chat = None,
|
||||
from_user: User = None,
|
||||
forward_from: User = None,
|
||||
forward_from_chat: Chat = None,
|
||||
forward_from_message_id: int = None,
|
||||
forward_signature: str = None,
|
||||
forward_date: int = None,
|
||||
reply_to_message: "Message" = None,
|
||||
mentioned: bool = None,
|
||||
empty: bool = None,
|
||||
service: bool = None,
|
||||
media: bool = None,
|
||||
edit_date: int = None,
|
||||
media_group_id: str = None,
|
||||
author_signature: str = None,
|
||||
text: str = None,
|
||||
entities: List["pyrogram.MessageEntity"] = None,
|
||||
caption_entities: List["pyrogram.MessageEntity"] = None,
|
||||
audio: "pyrogram.Audio" = None,
|
||||
document: "pyrogram.Document" = None,
|
||||
photo: "pyrogram.Photo" = None,
|
||||
sticker: "pyrogram.Sticker" = None,
|
||||
animation: "pyrogram.Animation" = None,
|
||||
game: "pyrogram.Game" = None,
|
||||
video: "pyrogram.Video" = None,
|
||||
voice: "pyrogram.Voice" = None,
|
||||
video_note: "pyrogram.VideoNote" = None,
|
||||
caption: str = None,
|
||||
contact: "pyrogram.Contact" = None,
|
||||
location: "pyrogram.Location" = None,
|
||||
venue: "pyrogram.Venue" = None,
|
||||
web_page: bool = None,
|
||||
poll: "pyrogram.Poll" = None,
|
||||
new_chat_members: List[User] = None,
|
||||
left_chat_member: User = None,
|
||||
new_chat_title: str = None,
|
||||
new_chat_photo: "pyrogram.Photo" = None,
|
||||
delete_chat_photo: bool = None,
|
||||
group_chat_created: bool = None,
|
||||
supergroup_chat_created: bool = None,
|
||||
channel_chat_created: bool = None,
|
||||
migrate_to_chat_id: int = None,
|
||||
migrate_from_chat_id: int = None,
|
||||
pinned_message: "Message" = None,
|
||||
game_high_score: int = None,
|
||||
views: int = None,
|
||||
via_bot: User = None,
|
||||
outgoing: bool = None,
|
||||
matches: List[Match] = None,
|
||||
command: List[str] = None,
|
||||
reply_markup: Union[
|
||||
"pyrogram.InlineKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardMarkup",
|
||||
"pyrogram.ReplyKeyboardRemove",
|
||||
"pyrogram.ForceReply"
|
||||
] = None
|
||||
):
|
||||
super().__init__(client)
|
||||
|
||||
|
@ -66,14 +66,14 @@ class MessageEntity(PyrogramType):
|
||||
}
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
client: "pyrogram.client.ext.BaseClient",
|
||||
type: str,
|
||||
offset: int,
|
||||
length: int,
|
||||
url: str = None,
|
||||
user: User = None
|
||||
self,
|
||||
*,
|
||||
client: "pyrogram.client.ext.BaseClient",
|
||||
type: str,
|
||||
offset: int,
|
||||
length: int,
|
||||
url: str = None,
|
||||
user: User = None
|
||||
):
|
||||
super().__init__(client)
|
||||
|
||||
|
@ -40,11 +40,11 @@ class Messages(PyrogramType, Update):
|
||||
__slots__ = ["total_count", "messages"]
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
client: "pyrogram.client.ext.BaseClient",
|
||||
total_count: int,
|
||||
messages: List[Message]
|
||||
self,
|
||||
*,
|
||||
client: "pyrogram.client.ext.BaseClient",
|
||||
total_count: int,
|
||||
messages: List[Message]
|
||||
):
|
||||
super().__init__(client)
|
||||
|
||||
|
@ -44,12 +44,12 @@ class Photo(PyrogramType):
|
||||
__slots__ = ["id", "date", "sizes"]
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
client: "pyrogram.client.ext.BaseClient",
|
||||
id: str,
|
||||
date: int,
|
||||
sizes: List[PhotoSize]
|
||||
self,
|
||||
*,
|
||||
client: "pyrogram.client.ext.BaseClient",
|
||||
id: str,
|
||||
date: int,
|
||||
sizes: List[PhotoSize]
|
||||
):
|
||||
super().__init__(client)
|
||||
|
||||
|
@ -45,13 +45,13 @@ class PhotoSize(PyrogramType):
|
||||
__slots__ = ["file_id", "width", "height", "file_size"]
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
client: "pyrogram.client.ext.BaseClient",
|
||||
file_id: str,
|
||||
width: int,
|
||||
height: int,
|
||||
file_size: int
|
||||
self,
|
||||
*,
|
||||
client: "pyrogram.client.ext.BaseClient",
|
||||
file_id: str,
|
||||
width: int,
|
||||
height: int,
|
||||
file_size: int
|
||||
):
|
||||
super().__init__(client)
|
||||
|
||||
|
@ -50,15 +50,15 @@ class Poll(PyrogramType):
|
||||
__slots__ = ["id", "closed", "question", "options", "total_voters", "option_chosen"]
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
client: "pyrogram.client.ext.BaseClient",
|
||||
id: int,
|
||||
closed: bool,
|
||||
question: str,
|
||||
options: List[PollOption],
|
||||
total_voters: int,
|
||||
option_chosen: int = None
|
||||
self,
|
||||
*,
|
||||
client: "pyrogram.client.ext.BaseClient",
|
||||
id: int,
|
||||
closed: bool,
|
||||
question: str,
|
||||
options: List[PollOption],
|
||||
total_voters: int,
|
||||
option_chosen: int = None
|
||||
):
|
||||
super().__init__(client)
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user