2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-08-29 13:27:47 +00:00

Reformat code

This commit is contained in:
Dan 2019-03-16 19:23:23 +01:00
parent bdb03957db
commit 3e18945f3c
117 changed files with 974 additions and 802 deletions

View File

@ -16,5 +16,5 @@
# You should have received a copy of the GNU Lesser General Public License # You should have received a copy of the GNU Lesser General Public License
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>. # along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
from .exceptions import *
from .error import UnknownError from .error import UnknownError
from .exceptions import *

View File

@ -21,12 +21,14 @@ from pyrogram.client.ext import BaseClient
class AnswerCallbackQuery(BaseClient): class AnswerCallbackQuery(BaseClient):
def answer_callback_query(self, def answer_callback_query(
self,
callback_query_id: str, callback_query_id: str,
text: str = None, text: str = None,
show_alert: bool = None, show_alert: bool = None,
url: str = None, url: str = None,
cache_time: int = 0): cache_time: int = 0
):
"""Use this method to send answers to callback queries sent from inline keyboards. """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. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert.

View File

@ -24,10 +24,12 @@ from pyrogram.client.ext import BaseClient
class GetGameHighScores(BaseClient): class GetGameHighScores(BaseClient):
def get_game_high_scores(self, def get_game_high_scores(
self,
user_id: Union[int, str], user_id: Union[int, str],
chat_id: Union[int, str], chat_id: Union[int, str],
message_id: int = None): message_id: int = None
):
"""Use this method to get data for high score tables. """Use this method to get data for high score tables.
Args: Args:

View File

@ -24,12 +24,14 @@ from pyrogram.client.ext import BaseClient
class GetInlineBotResults(BaseClient): class GetInlineBotResults(BaseClient):
def get_inline_bot_results(self, def get_inline_bot_results(
self,
bot: Union[int, str], bot: Union[int, str],
query: str, query: str,
offset: str = "", offset: str = "",
latitude: float = None, latitude: float = None,
longitude: float = None): longitude: float = None
):
"""Use this method to get bot results via inline queries. """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>` You can then send a result using :obj:`send_inline_bot_result <pyrogram.Client.send_inline_bot_result>`

View File

@ -23,10 +23,12 @@ from pyrogram.client.ext import BaseClient
class RequestCallbackAnswer(BaseClient): class RequestCallbackAnswer(BaseClient):
def request_callback_answer(self, def request_callback_answer(
self,
chat_id: Union[int, str], chat_id: Union[int, str],
message_id: int, message_id: int,
callback_data: bytes): callback_data: bytes
):
"""Use this method to request a callback answer from bots. This is the equivalent of clicking an """Use this method to request a callback answer from bots. This is the equivalent of clicking an
inline button containing callback data. inline button containing callback data.

View File

@ -24,15 +24,19 @@ from pyrogram.client.ext import BaseClient
class SendGame(BaseClient): class SendGame(BaseClient):
def send_game(self, def send_game(
self,
chat_id: Union[int, str], chat_id: Union[int, str],
game_short_name: str, game_short_name: str,
disable_notification: bool = None, disable_notification: bool = None,
reply_to_message_id: int = None, reply_to_message_id: int = None,
reply_markup: Union["pyrogram.InlineKeyboardMarkup", reply_markup: Union[
"pyrogram.InlineKeyboardMarkup",
"pyrogram.ReplyKeyboardMarkup", "pyrogram.ReplyKeyboardMarkup",
"pyrogram.ReplyKeyboardRemove", "pyrogram.ReplyKeyboardRemove",
"pyrogram.ForceReply"] = None) -> "pyrogram.Message": "pyrogram.ForceReply"
] = None
) -> "pyrogram.Message":
"""Use this method to send a game. """Use this method to send a game.
Args: Args:

View File

@ -23,13 +23,15 @@ from pyrogram.client.ext import BaseClient
class SendInlineBotResult(BaseClient): class SendInlineBotResult(BaseClient):
def send_inline_bot_result(self, def send_inline_bot_result(
self,
chat_id: Union[int, str], chat_id: Union[int, str],
query_id: int, query_id: int,
result_id: str, result_id: str,
disable_notification: bool = None, disable_notification: bool = None,
reply_to_message_id: int = None, reply_to_message_id: int = None,
hide_via: bool = None): hide_via: bool = None
):
"""Use this method to send an inline bot result. """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>` Bot results can be retrieved using :obj:`get_inline_bot_results <pyrogram.Client.get_inline_bot_results>`

View File

@ -24,13 +24,15 @@ from pyrogram.client.ext import BaseClient
class SetGameScore(BaseClient): class SetGameScore(BaseClient):
def set_game_score(self, def set_game_score(
self,
user_id: Union[int, str], user_id: Union[int, str],
score: int, score: int,
force: bool = None, force: bool = None,
disable_edit_message: bool = None, disable_edit_message: bool = None,
chat_id: Union[int, str] = None, chat_id: Union[int, str] = None,
message_id: int = None): message_id: int = None
):
# inline_message_id: str = None): TODO Add inline_message_id # inline_message_id: str = None): TODO Add inline_message_id
"""Use this method to set the score of the specified user in a game. """Use this method to set the score of the specified user in a game.

View File

@ -23,8 +23,10 @@ from ...ext import BaseClient
class DeleteChatPhoto(BaseClient): class DeleteChatPhoto(BaseClient):
def delete_chat_photo(self, def delete_chat_photo(
chat_id: Union[int, str]) -> bool: self,
chat_id: Union[int, str]
) -> bool:
"""Use this method to delete a chat photo. """Use this method to delete a chat photo.
Photos can't be changed for private chats. 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. You must be an administrator in the chat for this to work and must have the appropriate admin rights.

View File

@ -23,8 +23,10 @@ from ...ext import BaseClient
class ExportChatInviteLink(BaseClient): class ExportChatInviteLink(BaseClient):
def export_chat_invite_link(self, def export_chat_invite_link(
chat_id: Union[int, str]) -> str: 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. """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. You must be an administrator in the chat for this to work and have the appropriate admin rights.

View File

@ -24,8 +24,10 @@ from ...ext import BaseClient
class GetChat(BaseClient): class GetChat(BaseClient):
def get_chat(self, def get_chat(
chat_id: Union[int, str]) -> "pyrogram.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 """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.) one-on-one conversations, current username of a user, group or channel, etc.)

View File

@ -24,9 +24,11 @@ from ...ext import BaseClient
class GetChatMember(BaseClient): class GetChatMember(BaseClient):
def get_chat_member(self, def get_chat_member(
self,
chat_id: Union[int, str], chat_id: Union[int, str],
user_id: Union[int, str]) -> "pyrogram.ChatMember": user_id: Union[int, str]
) -> "pyrogram.ChatMember":
"""Use this method to get information about one member of a chat. """Use this method to get information about one member of a chat.
Args: Args:

View File

@ -33,12 +33,14 @@ class Filters:
class GetChatMembers(BaseClient): class GetChatMembers(BaseClient):
def get_chat_members(self, def get_chat_members(
self,
chat_id: Union[int, str], chat_id: Union[int, str],
offset: int = 0, offset: int = 0,
limit: int = 200, limit: int = 200,
query: str = "", query: str = "",
filter: str = Filters.ALL) -> "pyrogram.ChatMembers": filter: str = Filters.ALL
) -> "pyrogram.ChatMembers":
"""Use this method to get a chunk of the members list of a chat. """Use this method to get a chunk of the members list of a chat.
You can get up to 200 chat members at once. You can get up to 200 chat members at once.

View File

@ -23,8 +23,10 @@ from ...ext import BaseClient
class GetChatMembersCount(BaseClient): class GetChatMembersCount(BaseClient):
def get_chat_members_count(self, def get_chat_members_count(
chat_id: Union[int, str]) -> int: self,
chat_id: Union[int, str]
) -> int:
"""Use this method to get the number of members in a chat. """Use this method to get the number of members in a chat.
Args: Args:

View File

@ -22,8 +22,10 @@ from ...ext import BaseClient
class GetChatPreview(BaseClient): class GetChatPreview(BaseClient):
def get_chat_preview(self, def get_chat_preview(
invite_link: str): self,
invite_link: str
):
"""Use this method to get the preview of a chat using the invite link. """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` This method only returns a chat preview, if you want to join a chat use :meth:`join_chat`

View File

@ -28,10 +28,12 @@ log = logging.getLogger(__name__)
class GetDialogs(BaseClient): class GetDialogs(BaseClient):
def get_dialogs(self, def get_dialogs(
self,
offset_date: int = 0, offset_date: int = 0,
limit: int = 100, limit: int = 100,
pinned_only: bool = False) -> "pyrogram.Dialogs": pinned_only: bool = False
) -> "pyrogram.Dialogs":
"""Use this method to get a chunk of the user's dialogs """Use this method to get a chunk of the user's dialogs
You can get up to 100 dialogs at once. You can get up to 100 dialogs at once.

View File

@ -38,11 +38,13 @@ QUERYABLE_FILTERS = (Filters.ALL, Filters.KICKED, Filters.RESTRICTED)
class IterChatMembers(BaseClient): class IterChatMembers(BaseClient):
def iter_chat_members(self, def iter_chat_members(
self,
chat_id: Union[int, str], chat_id: Union[int, str],
limit: int = 0, limit: int = 0,
query: str = "", query: str = "",
filter: str = Filters.ALL) -> Generator["pyrogram.ChatMember", None, None]: filter: str = Filters.ALL
) -> Generator["pyrogram.ChatMember", None, None]:
"""Use this method to iterate through the members of a chat sequentially. """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 This convenience method does the same as repeatedly calling :meth:`get_chat_members` in a loop, thus saving you

View File

@ -23,9 +23,11 @@ from ...ext import BaseClient
class IterDialogs(BaseClient): class IterDialogs(BaseClient):
def iter_dialogs(self, def iter_dialogs(
self,
offset_date: int = 0, offset_date: int = 0,
limit: int = 0) -> Generator["pyrogram.Dialog", None, None]: limit: int = 0
) -> Generator["pyrogram.Dialog", None, None]:
"""Use this method to iterate through a user's dialogs sequentially. """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 This convenience method does the same as repeatedly calling :meth:`get_dialogs` in a loop, thus saving you from

View File

@ -22,8 +22,10 @@ from ...ext import BaseClient
class JoinChat(BaseClient): class JoinChat(BaseClient):
def join_chat(self, def join_chat(
chat_id: str): self,
chat_id: str
):
"""Use this method to join a group chat or channel. """Use this method to join a group chat or channel.
Args: Args:

View File

@ -24,10 +24,12 @@ from ...ext import BaseClient
class KickChatMember(BaseClient): class KickChatMember(BaseClient):
def kick_chat_member(self, def kick_chat_member(
self,
chat_id: Union[int, str], chat_id: Union[int, str],
user_id: Union[int, str], user_id: Union[int, str],
until_date: int = 0) -> Union["pyrogram.Message", bool]: until_date: int = 0
) -> Union["pyrogram.Message", bool]:
"""Use this method to kick a user from a group, a supergroup or a channel. """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 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 invite links, etc., unless unbanned first. You must be an administrator in the chat for this to work and must

View File

@ -23,9 +23,11 @@ from ...ext import BaseClient
class LeaveChat(BaseClient): class LeaveChat(BaseClient):
def leave_chat(self, def leave_chat(
self,
chat_id: Union[int, str], chat_id: Union[int, str],
delete: bool = False): delete: bool = False
):
"""Use this method to leave a group chat or channel. """Use this method to leave a group chat or channel.
Args: Args:

View File

@ -23,10 +23,12 @@ from ...ext import BaseClient
class PinChatMessage(BaseClient): class PinChatMessage(BaseClient):
def pin_chat_message(self, def pin_chat_message(
self,
chat_id: Union[int, str], chat_id: Union[int, str],
message_id: int, message_id: int,
disable_notification: bool = None) -> bool: disable_notification: bool = None
) -> bool:
"""Use this method to pin a message in a group, channel or your own chat. """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 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. the supergroup or "can_edit_messages" admin right in the channel.
@ -55,3 +57,5 @@ class PinChatMessage(BaseClient):
silent=disable_notification or None silent=disable_notification or None
) )
) )
return True

View File

@ -23,7 +23,8 @@ from ...ext import BaseClient
class PromoteChatMember(BaseClient): class PromoteChatMember(BaseClient):
def promote_chat_member(self, def promote_chat_member(
self,
chat_id: Union[int, str], chat_id: Union[int, str],
user_id: Union[int, str], user_id: Union[int, str],
can_change_info: bool = True, can_change_info: bool = True,
@ -33,7 +34,8 @@ class PromoteChatMember(BaseClient):
can_restrict_members: bool = True, can_restrict_members: bool = True,
can_invite_users: bool = True, can_invite_users: bool = True,
can_pin_messages: bool = False, can_pin_messages: bool = False,
can_promote_members: bool = False) -> bool: can_promote_members: bool = False
) -> bool:
"""Use this method to promote or demote a user in a supergroup or a channel. """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. You must be an administrator in the chat for this to work and must have the appropriate admin rights.

View File

@ -23,9 +23,11 @@ from ...ext import BaseClient
class SetChatDescription(BaseClient): class SetChatDescription(BaseClient):
def set_chat_description(self, def set_chat_description(
self,
chat_id: Union[int, str], chat_id: Union[int, str],
description: str) -> bool: description: str
) -> bool:
"""Use this method to change the description of a supergroup or a channel. """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. You must be an administrator in the chat for this to work and must have the appropriate admin rights.

View File

@ -26,9 +26,11 @@ from ...ext import BaseClient
class SetChatPhoto(BaseClient): class SetChatPhoto(BaseClient):
def set_chat_photo(self, def set_chat_photo(
self,
chat_id: Union[int, str], chat_id: Union[int, str],
photo: str) -> bool: photo: str
) -> bool:
"""Use this method to set a new profile photo for the chat. """Use this method to set a new profile photo for the chat.
Photos can't be changed for private chats. 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. You must be an administrator in the chat for this to work and must have the appropriate admin rights.

View File

@ -23,9 +23,11 @@ from ...ext import BaseClient
class SetChatTitle(BaseClient): class SetChatTitle(BaseClient):
def set_chat_title(self, def set_chat_title(
self,
chat_id: Union[int, str], chat_id: Union[int, str],
title: str) -> bool: title: str
) -> bool:
"""Use this method to change the title of a chat. """Use this method to change the title of a chat.
Titles can't be changed for private chats. 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. You must be an administrator in the chat for this to work and must have the appropriate admin rights.

View File

@ -23,9 +23,11 @@ from ...ext import BaseClient
class UnbanChatMember(BaseClient): class UnbanChatMember(BaseClient):
def unban_chat_member(self, def unban_chat_member(
self,
chat_id: Union[int, str], chat_id: Union[int, str],
user_id: Union[int, str]) -> bool: user_id: Union[int, str]
) -> bool:
"""Use this method to unban a previously kicked user in a supergroup or channel. """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. 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. You must be an administrator for this to work.

View File

@ -23,8 +23,10 @@ from ...ext import BaseClient
class UnpinChatMessage(BaseClient): class UnpinChatMessage(BaseClient):
def unpin_chat_message(self, def unpin_chat_message(
chat_id: Union[int, str]) -> bool: self,
chat_id: Union[int, str]
) -> bool:
"""Use this method to unpin a message in a group, channel or your own chat. """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 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. right in the supergroup or "can_edit_messages" admin right in the channel.

View File

@ -23,9 +23,11 @@ from ...ext import BaseClient
class UpdateChatUsername(BaseClient): class UpdateChatUsername(BaseClient):
def update_chat_username(self, def update_chat_username(
self,
chat_id: Union[int, str], chat_id: Union[int, str],
username: Union[str, None]) -> bool: username: Union[str, None]
) -> bool:
"""Use this method to update a channel or a supergroup username. """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`. To update your own username (for users only, not bots) you can use :meth:`update_username`.

View File

@ -24,8 +24,10 @@ from ...ext import BaseClient
class AddContacts(BaseClient): class AddContacts(BaseClient):
def add_contacts(self, def add_contacts(
contacts: List["pyrogram.InputPhoneContact"]): self,
contacts: List["pyrogram.InputPhoneContact"]
):
"""Use this method to add contacts to your Telegram address book. """Use this method to add contacts to your Telegram address book.
Args: Args:

View File

@ -24,8 +24,10 @@ from ...ext import BaseClient
class DeleteContacts(BaseClient): class DeleteContacts(BaseClient):
def delete_contacts(self, def delete_contacts(
ids: List[int]): self,
ids: List[int]
):
"""Use this method to delete contacts from your Telegram address book """Use this method to delete contacts from your Telegram address book
Args: Args:

View File

@ -25,9 +25,11 @@ from ...ext import BaseClient
class OnCallbackQuery(BaseClient): class OnCallbackQuery(BaseClient):
def on_callback_query(self=None, def on_callback_query(
self=None,
filters=None, filters=None,
group: int = 0) -> callable: group: int = 0
) -> callable:
"""Use this decorator to automatically register a function for handling """Use this decorator to automatically register a function for handling
callback queries. This does the same thing as :meth:`add_handler` using the callback queries. This does the same thing as :meth:`add_handler` using the
:class:`CallbackQueryHandler`. :class:`CallbackQueryHandler`.

View File

@ -25,9 +25,11 @@ from ...ext import BaseClient
class OnDeletedMessages(BaseClient): class OnDeletedMessages(BaseClient):
def on_deleted_messages(self=None, def on_deleted_messages(
self=None,
filters=None, filters=None,
group: int = 0) -> callable: group: int = 0
) -> callable:
"""Use this decorator to automatically register a function for handling """Use this decorator to automatically register a function for handling
deleted messages. This does the same thing as :meth:`add_handler` using the deleted messages. This does the same thing as :meth:`add_handler` using the
:class:`DeletedMessagesHandler`. :class:`DeletedMessagesHandler`.

View File

@ -25,9 +25,11 @@ from ...ext import BaseClient
class OnMessage(BaseClient): class OnMessage(BaseClient):
def on_message(self=None, def on_message(
self=None,
filters=None, filters=None,
group: int = 0) -> callable: group: int = 0
) -> callable:
"""Use this decorator to automatically register a function for handling """Use this decorator to automatically register a function for handling
messages. This does the same thing as :meth:`add_handler` using the messages. This does the same thing as :meth:`add_handler` using the
:class:`MessageHandler`. :class:`MessageHandler`.

View File

@ -24,8 +24,10 @@ from ...ext import BaseClient
class OnRawUpdate(BaseClient): class OnRawUpdate(BaseClient):
def on_raw_update(self=None, def on_raw_update(
group: int = 0) -> callable: self=None,
group: int = 0
) -> callable:
"""Use this decorator to automatically register a function for handling """Use this decorator to automatically register a function for handling
raw updates. This does the same thing as :meth:`add_handler` using the raw updates. This does the same thing as :meth:`add_handler` using the
:class:`RawUpdateHandler`. :class:`RawUpdateHandler`.

View File

@ -25,9 +25,11 @@ from ...ext import BaseClient
class OnUserStatus(BaseClient): class OnUserStatus(BaseClient):
def on_user_status(self=None, def on_user_status(
self=None,
filters=None, filters=None,
group: int = 0) -> callable: group: int = 0
) -> callable:
"""Use this decorator to automatically register a function for handling """Use this decorator to automatically register a function for handling
user status updates. This does the same thing as :meth:`add_handler` using the user status updates. This does the same thing as :meth:`add_handler` using the
:class:`UserStatusHandler`. :class:`UserStatusHandler`.

View File

@ -23,9 +23,11 @@ from pyrogram.client.ext import BaseClient
class ClosePoll(BaseClient): class ClosePoll(BaseClient):
def close_poll(self, def close_poll(
self,
chat_id: Union[int, str], chat_id: Union[int, str],
message_id: id) -> bool: message_id: id
) -> bool:
"""Use this method to close (stop) a poll. """Use this method to close (stop) a poll.
Closed polls can't be reopened and nobody will be able to vote in it anymore. Closed polls can't be reopened and nobody will be able to vote in it anymore.

View File

@ -23,10 +23,12 @@ from pyrogram.client.ext import BaseClient
class DeleteMessages(BaseClient): class DeleteMessages(BaseClient):
def delete_messages(self, def delete_messages(
self,
chat_id: Union[int, str], chat_id: Union[int, str],
message_ids: Iterable[int], message_ids: Iterable[int],
revoke: bool = True) -> bool: revoke: bool = True
) -> bool:
"""Use this method to delete messages, including service messages, with the following limitations: """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. - A message can only be deleted if it was sent less than 48 hours ago.

View File

@ -24,12 +24,14 @@ from pyrogram.client.ext import BaseClient
class DownloadMedia(BaseClient): class DownloadMedia(BaseClient):
def download_media(self, def download_media(
self,
message: Union["pyrogram.Message", str], message: Union["pyrogram.Message", str],
file_name: str = "", file_name: str = "",
block: bool = True, block: bool = True,
progress: callable = None, progress: callable = None,
progress_args: tuple = ()) -> Union[str, None]: progress_args: tuple = ()
) -> Union[str, None]:
"""Use this method to download the media from a Message. """Use this method to download the media from a Message.
Args: Args:

View File

@ -24,12 +24,14 @@ from pyrogram.client.ext import BaseClient
class EditMessageCaption(BaseClient): class EditMessageCaption(BaseClient):
def edit_message_caption(self, def edit_message_caption(
self,
chat_id: Union[int, str], chat_id: Union[int, str],
message_id: int, message_id: int,
caption: str, caption: str,
parse_mode: str = "", parse_mode: str = "",
reply_markup: "pyrogram.InlineKeyboardMarkup" = None) -> "pyrogram.Message": reply_markup: "pyrogram.InlineKeyboardMarkup" = None
) -> "pyrogram.Message":
"""Use this method to edit captions of messages. """Use this method to edit captions of messages.
Args: Args:

View File

@ -33,11 +33,13 @@ from pyrogram.client.types.input_media import InputMedia
class EditMessageMedia(BaseClient): class EditMessageMedia(BaseClient):
def edit_message_media(self, def edit_message_media(
self,
chat_id: Union[int, str], chat_id: Union[int, str],
message_id: int, message_id: int,
media: InputMedia, media: InputMedia,
reply_markup: "pyrogram.InlineKeyboardMarkup" = None) -> "pyrogram.Message": reply_markup: "pyrogram.InlineKeyboardMarkup" = None
) -> "pyrogram.Message":
"""Use this method to edit audio, document, photo, or video messages. """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, If a message is a part of a message album, then it can be edited only to a photo or a video. Otherwise,

View File

@ -24,10 +24,12 @@ from pyrogram.client.ext import BaseClient
class EditMessageReplyMarkup(BaseClient): class EditMessageReplyMarkup(BaseClient):
def edit_message_reply_markup(self, def edit_message_reply_markup(
self,
chat_id: Union[int, str], chat_id: Union[int, str],
message_id: int, message_id: int,
reply_markup: "pyrogram.InlineKeyboardMarkup" = None) -> "pyrogram.Message": 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). """Use this method to edit only the reply markup of messages sent by the bot or via the bot (for inline bots).
Args: Args:

View File

@ -24,13 +24,15 @@ from pyrogram.client.ext import BaseClient
class EditMessageText(BaseClient): class EditMessageText(BaseClient):
def edit_message_text(self, def edit_message_text(
self,
chat_id: Union[int, str], chat_id: Union[int, str],
message_id: int, message_id: int,
text: str, text: str,
parse_mode: str = "", parse_mode: str = "",
disable_web_page_preview: bool = None, disable_web_page_preview: bool = None,
reply_markup: "pyrogram.InlineKeyboardMarkup" = None) -> "pyrogram.Message": reply_markup: "pyrogram.InlineKeyboardMarkup" = None
) -> "pyrogram.Message":
"""Use this method to edit text messages. """Use this method to edit text messages.
Args: Args:

View File

@ -24,11 +24,13 @@ from ...ext import BaseClient
class ForwardMessages(BaseClient): class ForwardMessages(BaseClient):
def forward_messages(self, def forward_messages(
self,
chat_id: Union[int, str], chat_id: Union[int, str],
from_chat_id: Union[int, str], from_chat_id: Union[int, str],
message_ids: Iterable[int], message_ids: Iterable[int],
disable_notification: bool = None) -> "pyrogram.Messages": disable_notification: bool = None
) -> "pyrogram.Messages":
"""Use this method to forward messages of any kind. """Use this method to forward messages of any kind.
Args: Args:

View File

@ -29,13 +29,15 @@ log = logging.getLogger(__name__)
class GetHistory(BaseClient): class GetHistory(BaseClient):
def get_history(self, def get_history(
self,
chat_id: Union[int, str], chat_id: Union[int, str],
limit: int = 100, limit: int = 100,
offset: int = 0, offset: int = 0,
offset_id: int = 0, offset_id: int = 0,
offset_date: int = 0, offset_date: int = 0,
reverse: bool = False): reverse: bool = False
):
"""Use this method to retrieve a chunk of the history of a chat. """Use this method to retrieve a chunk of the history of a chat.
You can get up to 100 messages at once. You can get up to 100 messages at once.

View File

@ -29,11 +29,13 @@ log = logging.getLogger(__name__)
class GetMessages(BaseClient): class GetMessages(BaseClient):
def get_messages(self, def get_messages(
self,
chat_id: Union[int, str], chat_id: Union[int, str],
message_ids: Union[int, Iterable[int]] = None, message_ids: Union[int, Iterable[int]] = None,
reply_to_message_ids: Union[int, Iterable[int]] = None, reply_to_message_ids: Union[int, Iterable[int]] = None,
replies: int = 1) -> Union["pyrogram.Message", "pyrogram.Messages"]: replies: int = 1
) -> Union["pyrogram.Message", "pyrogram.Messages"]:
"""Use this method to get one or more messages that belong to a specific chat. """Use this method to get one or more messages that belong to a specific chat.
You can retrieve up to 200 messages at once. You can retrieve up to 200 messages at once.

View File

@ -23,13 +23,15 @@ from ...ext import BaseClient
class IterHistory(BaseClient): class IterHistory(BaseClient):
def iter_history(self, def iter_history(
self,
chat_id: Union[int, str], chat_id: Union[int, str],
limit: int = 0, limit: int = 0,
offset: int = 0, offset: int = 0,
offset_id: int = 0, offset_id: int = 0,
offset_date: int = 0, offset_date: int = 0,
reverse: bool = False) -> Generator["pyrogram.Message", None, None]: reverse: bool = False
) -> Generator["pyrogram.Message", None, None]:
"""Use this method to iterate through a chat history sequentially. """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 This convenience method does the same as repeatedly calling :meth:`get_history` in a loop, thus saving you from

View File

@ -23,9 +23,11 @@ from pyrogram.client.ext import BaseClient
class RetractVote(BaseClient): class RetractVote(BaseClient):
def retract_vote(self, def retract_vote(
self,
chat_id: Union[int, str], chat_id: Union[int, str],
message_id: id) -> bool: message_id: id
) -> bool:
"""Use this method to retract your vote in a poll. """Use this method to retract your vote in a poll.
Args: Args:

View File

@ -28,7 +28,8 @@ from pyrogram.client.ext import BaseClient, utils
class SendAnimation(BaseClient): class SendAnimation(BaseClient):
def send_animation(self, def send_animation(
self,
chat_id: Union[int, str], chat_id: Union[int, str],
animation: str, animation: str,
caption: str = "", caption: str = "",
@ -39,12 +40,15 @@ class SendAnimation(BaseClient):
thumb: str = None, thumb: str = None,
disable_notification: bool = None, disable_notification: bool = None,
reply_to_message_id: int = None, reply_to_message_id: int = None,
reply_markup: Union["pyrogram.InlineKeyboardMarkup", reply_markup: Union[
"pyrogram.InlineKeyboardMarkup",
"pyrogram.ReplyKeyboardMarkup", "pyrogram.ReplyKeyboardMarkup",
"pyrogram.ReplyKeyboardRemove", "pyrogram.ReplyKeyboardRemove",
"pyrogram.ForceReply"] = None, "pyrogram.ForceReply"
] = None,
progress: callable = None, progress: callable = None,
progress_args: tuple = ()) -> Union["pyrogram.Message", 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). """Use this method to send animation files (animation or H.264/MPEG-4 AVC video without sound).
Args: Args:

View File

@ -28,7 +28,8 @@ from pyrogram.client.ext import BaseClient, utils
class SendAudio(BaseClient): class SendAudio(BaseClient):
def send_audio(self, def send_audio(
self,
chat_id: Union[int, str], chat_id: Union[int, str],
audio: str, audio: str,
caption: str = "", caption: str = "",
@ -39,12 +40,15 @@ class SendAudio(BaseClient):
thumb: str = None, thumb: str = None,
disable_notification: bool = None, disable_notification: bool = None,
reply_to_message_id: int = None, reply_to_message_id: int = None,
reply_markup: Union["pyrogram.InlineKeyboardMarkup", reply_markup: Union[
"pyrogram.InlineKeyboardMarkup",
"pyrogram.ReplyKeyboardMarkup", "pyrogram.ReplyKeyboardMarkup",
"pyrogram.ReplyKeyboardRemove", "pyrogram.ReplyKeyboardRemove",
"pyrogram.ForceReply"] = None, "pyrogram.ForceReply"
] = None,
progress: callable = None, progress: callable = None,
progress_args: tuple = ()) -> Union["pyrogram.Message", None]: progress_args: tuple = ()
) -> Union["pyrogram.Message", None]:
"""Use this method to send audio files. """Use this method to send audio files.
For sending voice messages, use the :obj:`send_voice()` method instead. For sending voice messages, use the :obj:`send_voice()` method instead.

View File

@ -23,10 +23,12 @@ from pyrogram.client.ext import BaseClient, ChatAction
class SendChatAction(BaseClient): class SendChatAction(BaseClient):
def send_chat_action(self, def send_chat_action(
self,
chat_id: Union[int, str], chat_id: Union[int, str],
action: Union[ChatAction, str], action: Union[ChatAction, str],
progress: int = 0): progress: int = 0
):
"""Use this method when you need to tell the other party that something is happening on your side. """Use this method when you need to tell the other party that something is happening on your side.
Args: Args:

View File

@ -24,7 +24,8 @@ from pyrogram.client.ext import BaseClient
class SendContact(BaseClient): class SendContact(BaseClient):
def send_contact(self, def send_contact(
self,
chat_id: Union[int, str], chat_id: Union[int, str],
phone_number: str, phone_number: str,
first_name: str, first_name: str,
@ -32,10 +33,13 @@ class SendContact(BaseClient):
vcard: str = "", vcard: str = "",
disable_notification: bool = None, disable_notification: bool = None,
reply_to_message_id: int = None, reply_to_message_id: int = None,
reply_markup: Union["pyrogram.InlineKeyboardMarkup", reply_markup: Union[
"pyrogram.InlineKeyboardMarkup",
"pyrogram.ReplyKeyboardMarkup", "pyrogram.ReplyKeyboardMarkup",
"pyrogram.ReplyKeyboardRemove", "pyrogram.ReplyKeyboardRemove",
"pyrogram.ForceReply"] = None) -> "pyrogram.Message": "pyrogram.ForceReply"
] = None
) -> "pyrogram.Message":
"""Use this method to send phone contacts. """Use this method to send phone contacts.
Args: Args:

View File

@ -28,7 +28,8 @@ from pyrogram.client.ext import BaseClient, utils
class SendDocument(BaseClient): class SendDocument(BaseClient):
def send_document(self, def send_document(
self,
chat_id: Union[int, str], chat_id: Union[int, str],
document: str, document: str,
thumb: str = None, thumb: str = None,
@ -36,12 +37,15 @@ class SendDocument(BaseClient):
parse_mode: str = "", parse_mode: str = "",
disable_notification: bool = None, disable_notification: bool = None,
reply_to_message_id: int = None, reply_to_message_id: int = None,
reply_markup: Union["pyrogram.InlineKeyboardMarkup", reply_markup: Union[
"pyrogram.InlineKeyboardMarkup",
"pyrogram.ReplyKeyboardMarkup", "pyrogram.ReplyKeyboardMarkup",
"pyrogram.ReplyKeyboardRemove", "pyrogram.ReplyKeyboardRemove",
"pyrogram.ForceReply"] = None, "pyrogram.ForceReply"
] = None,
progress: callable = None, progress: callable = None,
progress_args: tuple = ()) -> Union["pyrogram.Message", None]: progress_args: tuple = ()
) -> Union["pyrogram.Message", None]:
"""Use this method to send general files. """Use this method to send general files.
Args: Args:

View File

@ -24,16 +24,20 @@ from pyrogram.client.ext import BaseClient
class SendLocation(BaseClient): class SendLocation(BaseClient):
def send_location(self, def send_location(
self,
chat_id: Union[int, str], chat_id: Union[int, str],
latitude: float, latitude: float,
longitude: float, longitude: float,
disable_notification: bool = None, disable_notification: bool = None,
reply_to_message_id: int = None, reply_to_message_id: int = None,
reply_markup: Union["pyrogram.InlineKeyboardMarkup", reply_markup: Union[
"pyrogram.InlineKeyboardMarkup",
"pyrogram.ReplyKeyboardMarkup", "pyrogram.ReplyKeyboardMarkup",
"pyrogram.ReplyKeyboardRemove", "pyrogram.ReplyKeyboardRemove",
"pyrogram.ForceReply"] = None) -> "pyrogram.Message": "pyrogram.ForceReply"
] = None
) -> "pyrogram.Message":
"""Use this method to send points on the map. """Use this method to send points on the map.
Args: Args:

View File

@ -34,11 +34,13 @@ log = logging.getLogger(__name__)
class SendMediaGroup(BaseClient): class SendMediaGroup(BaseClient):
# TODO: Add progress parameter # TODO: Add progress parameter
# TODO: Figure out how to send albums using URLs # TODO: Figure out how to send albums using URLs
def send_media_group(self, def send_media_group(
self,
chat_id: Union[int, str], chat_id: Union[int, str],
media: List[Union["pyrogram.InputMediaPhoto", "pyrogram.InputMediaVideo"]], media: List[Union["pyrogram.InputMediaPhoto", "pyrogram.InputMediaVideo"]],
disable_notification: bool = None, disable_notification: bool = None,
reply_to_message_id: int = None): reply_to_message_id: int = None
):
"""Use this method to send a group of photos or videos as an album. """Use this method to send a group of photos or videos as an album.
Args: Args:

View File

@ -24,17 +24,21 @@ from ...ext import BaseClient
class SendMessage(BaseClient): class SendMessage(BaseClient):
def send_message(self, def send_message(
self,
chat_id: Union[int, str], chat_id: Union[int, str],
text: str, text: str,
parse_mode: str = "", parse_mode: str = "",
disable_web_page_preview: bool = None, disable_web_page_preview: bool = None,
disable_notification: bool = None, disable_notification: bool = None,
reply_to_message_id: int = None, reply_to_message_id: int = None,
reply_markup: Union["pyrogram.InlineKeyboardMarkup", reply_markup: Union[
"pyrogram.InlineKeyboardMarkup",
"pyrogram.ReplyKeyboardMarkup", "pyrogram.ReplyKeyboardMarkup",
"pyrogram.ReplyKeyboardRemove", "pyrogram.ReplyKeyboardRemove",
"pyrogram.ForceReply"] = None) -> "pyrogram.Message": "pyrogram.ForceReply"
] = None
) -> "pyrogram.Message":
"""Use this method to send text messages. """Use this method to send text messages.
Args: Args:

View File

@ -28,7 +28,8 @@ from pyrogram.client.ext import BaseClient, utils
class SendPhoto(BaseClient): class SendPhoto(BaseClient):
def send_photo(self, def send_photo(
self,
chat_id: Union[int, str], chat_id: Union[int, str],
photo: str, photo: str,
caption: str = "", caption: str = "",
@ -36,12 +37,15 @@ class SendPhoto(BaseClient):
ttl_seconds: int = None, ttl_seconds: int = None,
disable_notification: bool = None, disable_notification: bool = None,
reply_to_message_id: int = None, reply_to_message_id: int = None,
reply_markup: Union["pyrogram.InlineKeyboardMarkup", reply_markup: Union[
"pyrogram.InlineKeyboardMarkup",
"pyrogram.ReplyKeyboardMarkup", "pyrogram.ReplyKeyboardMarkup",
"pyrogram.ReplyKeyboardRemove", "pyrogram.ReplyKeyboardRemove",
"pyrogram.ForceReply"] = None, "pyrogram.ForceReply"
] = None,
progress: callable = None, progress: callable = None,
progress_args: tuple = ()) -> Union["pyrogram.Message", None]: progress_args: tuple = ()
) -> Union["pyrogram.Message", None]:
"""Use this method to send photos. """Use this method to send photos.
Args: Args:

View File

@ -24,16 +24,20 @@ from pyrogram.client.ext import BaseClient
class SendPoll(BaseClient): class SendPoll(BaseClient):
def send_poll(self, def send_poll \
(self,
chat_id: Union[int, str], chat_id: Union[int, str],
question: str, question: str,
options: List[str], options: List[str],
disable_notification: bool = None, disable_notification: bool = None,
reply_to_message_id: int = None, reply_to_message_id: int = None,
reply_markup: Union["pyrogram.InlineKeyboardMarkup", reply_markup: Union[
"pyrogram.InlineKeyboardMarkup",
"pyrogram.ReplyKeyboardMarkup", "pyrogram.ReplyKeyboardMarkup",
"pyrogram.ReplyKeyboardRemove", "pyrogram.ReplyKeyboardRemove",
"pyrogram.ForceReply"] = None) -> "pyrogram.Message": "pyrogram.ForceReply"
] = None
) -> "pyrogram.Message":
"""Use this method to send a new poll. """Use this method to send a new poll.
Args: Args:

View File

@ -28,17 +28,21 @@ from pyrogram.client.ext import BaseClient, utils
class SendSticker(BaseClient): class SendSticker(BaseClient):
def send_sticker(self, def send_sticker(
self,
chat_id: Union[int, str], chat_id: Union[int, str],
sticker: str, sticker: str,
disable_notification: bool = None, disable_notification: bool = None,
reply_to_message_id: int = None, reply_to_message_id: int = None,
reply_markup: Union["pyrogram.InlineKeyboardMarkup", reply_markup: Union[
"pyrogram.InlineKeyboardMarkup",
"pyrogram.ReplyKeyboardMarkup", "pyrogram.ReplyKeyboardMarkup",
"pyrogram.ReplyKeyboardRemove", "pyrogram.ReplyKeyboardRemove",
"pyrogram.ForceReply"] = None, "pyrogram.ForceReply"
] = None,
progress: callable = None, progress: callable = None,
progress_args: tuple = ()) -> Union["pyrogram.Message", None]: progress_args: tuple = ()
) -> Union["pyrogram.Message", None]:
"""Use this method to send .webp stickers. """Use this method to send .webp stickers.
Args: Args:

View File

@ -24,7 +24,8 @@ from pyrogram.client.ext import BaseClient
class SendVenue(BaseClient): class SendVenue(BaseClient):
def send_venue(self, def send_venue(
self,
chat_id: Union[int, str], chat_id: Union[int, str],
latitude: float, latitude: float,
longitude: float, longitude: float,
@ -34,10 +35,13 @@ class SendVenue(BaseClient):
foursquare_type: str = "", foursquare_type: str = "",
disable_notification: bool = None, disable_notification: bool = None,
reply_to_message_id: int = None, reply_to_message_id: int = None,
reply_markup: Union["pyrogram.InlineKeyboardMarkup", reply_markup: Union[
"pyrogram.InlineKeyboardMarkup",
"pyrogram.ReplyKeyboardMarkup", "pyrogram.ReplyKeyboardMarkup",
"pyrogram.ReplyKeyboardRemove", "pyrogram.ReplyKeyboardRemove",
"pyrogram.ForceReply"] = None) -> "pyrogram.Message": "pyrogram.ForceReply"
] = None
) -> "pyrogram.Message":
"""Use this method to send information about a venue. """Use this method to send information about a venue.
Args: Args:

View File

@ -28,7 +28,8 @@ from pyrogram.client.ext import BaseClient, utils
class SendVideo(BaseClient): class SendVideo(BaseClient):
def send_video(self, def send_video(
self,
chat_id: Union[int, str], chat_id: Union[int, str],
video: str, video: str,
caption: str = "", caption: str = "",
@ -40,12 +41,15 @@ class SendVideo(BaseClient):
supports_streaming: bool = True, supports_streaming: bool = True,
disable_notification: bool = None, disable_notification: bool = None,
reply_to_message_id: int = None, reply_to_message_id: int = None,
reply_markup: Union["pyrogram.InlineKeyboardMarkup", reply_markup: Union[
"pyrogram.InlineKeyboardMarkup",
"pyrogram.ReplyKeyboardMarkup", "pyrogram.ReplyKeyboardMarkup",
"pyrogram.ReplyKeyboardRemove", "pyrogram.ReplyKeyboardRemove",
"pyrogram.ForceReply"] = None, "pyrogram.ForceReply"
] = None,
progress: callable = None, progress: callable = None,
progress_args: tuple = ()) -> Union["pyrogram.Message", None]: progress_args: tuple = ()
) -> Union["pyrogram.Message", None]:
"""Use this method to send video files. """Use this method to send video files.
Args: Args:

View File

@ -28,7 +28,8 @@ from pyrogram.client.ext import BaseClient, utils
class SendVideoNote(BaseClient): class SendVideoNote(BaseClient):
def send_video_note(self, def send_video_note(
self,
chat_id: Union[int, str], chat_id: Union[int, str],
video_note: str, video_note: str,
duration: int = 0, duration: int = 0,
@ -36,12 +37,15 @@ class SendVideoNote(BaseClient):
thumb: str = None, thumb: str = None,
disable_notification: bool = None, disable_notification: bool = None,
reply_to_message_id: int = None, reply_to_message_id: int = None,
reply_markup: Union["pyrogram.InlineKeyboardMarkup", reply_markup: Union[
"pyrogram.InlineKeyboardMarkup",
"pyrogram.ReplyKeyboardMarkup", "pyrogram.ReplyKeyboardMarkup",
"pyrogram.ReplyKeyboardRemove", "pyrogram.ReplyKeyboardRemove",
"pyrogram.ForceReply"] = None, "pyrogram.ForceReply"
] = None,
progress: callable = None, progress: callable = None,
progress_args: tuple = ()) -> Union["pyrogram.Message", None]: progress_args: tuple = ()
) -> Union["pyrogram.Message", None]:
"""Use this method to send video messages. """Use this method to send video messages.
Args: Args:

View File

@ -28,7 +28,8 @@ from pyrogram.client.ext import BaseClient, utils
class SendVoice(BaseClient): class SendVoice(BaseClient):
def send_voice(self, def send_voice(
self,
chat_id: Union[int, str], chat_id: Union[int, str],
voice: str, voice: str,
caption: str = "", caption: str = "",
@ -36,12 +37,15 @@ class SendVoice(BaseClient):
duration: int = 0, duration: int = 0,
disable_notification: bool = None, disable_notification: bool = None,
reply_to_message_id: int = None, reply_to_message_id: int = None,
reply_markup: Union["pyrogram.InlineKeyboardMarkup", reply_markup: Union[
"pyrogram.InlineKeyboardMarkup",
"pyrogram.ReplyKeyboardMarkup", "pyrogram.ReplyKeyboardMarkup",
"pyrogram.ReplyKeyboardRemove", "pyrogram.ReplyKeyboardRemove",
"pyrogram.ForceReply"] = None, "pyrogram.ForceReply"
] = None,
progress: callable = None, progress: callable = None,
progress_args: tuple = ()) -> Union["pyrogram.Message", None]: progress_args: tuple = ()
) -> Union["pyrogram.Message", None]:
"""Use this method to send audio files. """Use this method to send audio files.
Args: Args:

View File

@ -23,10 +23,12 @@ from pyrogram.client.ext import BaseClient
class VotePoll(BaseClient): class VotePoll(BaseClient):
def vote_poll(self, def vote_poll(
self,
chat_id: Union[int, str], chat_id: Union[int, str],
message_id: id, message_id: id,
option: int) -> bool: option: int
) -> bool:
"""Use this method to vote a poll. """Use this method to vote a poll.
Args: Args:

View File

@ -24,10 +24,12 @@ from ...ext import BaseClient
class ChangeCloudPassword(BaseClient): class ChangeCloudPassword(BaseClient):
def change_cloud_password(self, def change_cloud_password(
self,
current_password: str, current_password: str,
new_password: str, new_password: str,
new_hint: str = "") -> bool: new_hint: str = ""
) -> bool:
"""Use this method to change your Two-Step Verification password (Cloud Password) with a new one. """Use this method to change your Two-Step Verification password (Cloud Password) with a new one.
Args: Args:

View File

@ -24,10 +24,12 @@ from ...ext import BaseClient
class EnableCloudPassword(BaseClient): class EnableCloudPassword(BaseClient):
def enable_cloud_password(self, def enable_cloud_password(
self,
password: str, password: str,
hint: str = "", hint: str = "",
email: str = None) -> bool: email: str = None
) -> bool:
"""Use this method to enable the Two-Step Verification security feature (Cloud Password) on your account. """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. This password will be asked when you log-in on a new device in addition to the SMS code.

View File

@ -22,8 +22,10 @@ from ...ext import BaseClient
class RemoveCloudPassword(BaseClient): class RemoveCloudPassword(BaseClient):
def remove_cloud_password(self, def remove_cloud_password(
password: str) -> bool: self,
password: str
) -> bool:
"""Use this method to turn off the Two-Step Verification security feature (Cloud Password) on your account. """Use this method to turn off the Two-Step Verification security feature (Cloud Password) on your account.
Args: Args:

View File

@ -25,8 +25,10 @@ from ...ext import BaseClient
class DeleteUserProfilePhotos(BaseClient): class DeleteUserProfilePhotos(BaseClient):
def delete_user_profile_photos(self, def delete_user_profile_photos(
id: Union[str, List[str]]) -> bool: self,
id: Union[str, List[str]]
) -> bool:
"""Use this method to delete your own profile photos """Use this method to delete your own profile photos
Args: Args:

View File

@ -24,10 +24,12 @@ from ...ext import BaseClient
class GetUserProfilePhotos(BaseClient): class GetUserProfilePhotos(BaseClient):
def get_user_profile_photos(self, def get_user_profile_photos(
self,
user_id: Union[int, str], user_id: Union[int, str],
offset: int = 0, offset: int = 0,
limit: int = 100) -> "pyrogram.UserProfilePhotos": limit: int = 100
) -> "pyrogram.UserProfilePhotos":
"""Use this method to get a list of profile pictures for a user. """Use this method to get a list of profile pictures for a user.
Args: Args:

View File

@ -24,8 +24,10 @@ from ...ext import BaseClient
class GetUsers(BaseClient): class GetUsers(BaseClient):
def get_users(self, def get_users(
user_ids: Iterable[Union[int, str]]) -> Union["pyrogram.User", List["pyrogram.User"]]: self,
user_ids: Iterable[Union[int, str]]
) -> Union["pyrogram.User", List["pyrogram.User"]]:
"""Use this method to get information about a user. """Use this method to get information about a user.
You can retrieve up to 200 users at once. You can retrieve up to 200 users at once.

View File

@ -21,8 +21,10 @@ from ...ext import BaseClient
class SetUserProfilePhoto(BaseClient): class SetUserProfilePhoto(BaseClient):
def set_user_profile_photo(self, def set_user_profile_photo(
photo: str) -> bool: self,
photo: str
) -> bool:
"""Use this method to set a new profile photo. """Use this method to set a new profile photo.
This method only works for Users. This method only works for Users.

View File

@ -23,8 +23,10 @@ from ...ext import BaseClient
class UpdateUsername(BaseClient): class UpdateUsername(BaseClient):
def update_username(self, def update_username(
username: Union[str, None]) -> bool: self,
username: Union[str, None]
) -> bool:
"""Use this method to update your own username. """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 This method only works for users, not bots. Bot usernames must be changed via Bot Support or by recreating