2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-08-28 21:07:59 +00:00

Use more concise and cleaner description of a method and a type

This commit is contained in:
Dan 2019-05-12 19:49:06 +02:00
parent eadda551c6
commit ef912d21ef
129 changed files with 153 additions and 141 deletions

View File

@ -261,7 +261,7 @@ class Client(Methods, BaseClient):
self._proxy.update(value)
def start(self):
"""Use this method to start the Client.
"""Start the Client.
Raises:
RPCError: In case of a Telegram RPC error.
@ -354,7 +354,7 @@ class Client(Methods, BaseClient):
return self
def stop(self):
"""Use this method to stop the Client.
"""Stop the Client.
Raises:
ConnectionError: In case you try to stop an already stopped Client.
@ -396,7 +396,7 @@ class Client(Methods, BaseClient):
return self
def restart(self):
"""Use this method to restart the Client.
"""Restart the Client.
Raises:
ConnectionError: In case you try to restart a stopped Client.
@ -405,7 +405,7 @@ class Client(Methods, BaseClient):
self.start()
def idle(self, stop_signals: tuple = (SIGINT, SIGTERM, SIGABRT)):
"""Use this method to block the main script execution until a signal (e.g.: from CTRL+C) is received.
"""Block the main script execution until a signal (e.g.: from CTRL+C) is received.
Once the signal is received, the client will automatically stop and the main script will continue its execution.
This is used after starting one or more clients and is useful for event-driven applications only, that are,
@ -438,7 +438,7 @@ class Client(Methods, BaseClient):
self.stop()
def run(self):
"""Use this method to start the Client and automatically idle the main script.
"""Start the Client and automatically idle the main script.
This is a convenience method that literally just calls :meth:`start` and :meth:`idle`. It makes running a client
less verbose, but is not suitable in case you want to run more than one client in a single main script,
@ -451,7 +451,7 @@ class Client(Methods, BaseClient):
self.idle()
def add_handler(self, handler: Handler, group: int = 0):
"""Use this method to register an update handler.
"""Register an update handler.
You can register multiple handlers, but at most one handler within a group
will be used for a single update. To handle the same update more than once, register
@ -475,7 +475,7 @@ class Client(Methods, BaseClient):
return handler, group
def remove_handler(self, handler: Handler, group: int = 0):
"""Use this method to remove a previously-registered update handler.
"""Remove a previously-registered update handler.
Make sure to provide the right group that the handler was added in. You can use
the return value of the :meth:`add_handler` method, a tuple of (handler, group), and
@ -494,7 +494,7 @@ class Client(Methods, BaseClient):
self.dispatcher.remove_handler(handler, group)
def stop_transmission(self):
"""Use this method to stop downloading or uploading a file.
"""Stop downloading or uploading a file.
Must be called inside a progress callback function.
"""
raise Client.StopTransmission
@ -1036,7 +1036,7 @@ class Client(Methods, BaseClient):
log.debug("{} stopped".format(name))
def send(self, data: Object, retries: int = Session.MAX_RETRIES, timeout: float = Session.WAIT_TIMEOUT):
"""Use this method to send raw Telegram queries.
"""Send raw Telegram queries.
This method makes it possible to manually call every single Telegram API method in a low-level manner.
Available functions are listed in the :obj:`functions <pyrogram.api.functions>` package and may accept compound
@ -1341,7 +1341,7 @@ class Client(Methods, BaseClient):
self.get_initial_dialogs_chunk()
def resolve_peer(self, peer_id: Union[int, str]):
"""Use this method to get the InputPeer of a known peer id.
"""Get the InputPeer of a known peer id.
Useful whenever an InputPeer type is required.
.. note::
@ -1423,7 +1423,7 @@ class Client(Methods, BaseClient):
progress: callable = None,
progress_args: tuple = ()
):
"""Use this method to upload a file onto Telegram servers, without actually sending the message to anyone.
"""Upload a file onto Telegram servers, without actually sending the message to anyone.
Useful whenever an InputFile type is required.
.. note::

View File

@ -23,7 +23,7 @@ from ..types.keyboards import InlineKeyboardMarkup, ReplyKeyboardMarkup
def create(name: str, func: callable, **kwargs) -> type:
"""Use this method to create a Filter.
"""Create a Filter.
Custom filters give you extra control over which updates are allowed or not to be processed by your handlers.

View File

@ -29,7 +29,7 @@ class AnswerCallbackQuery(BaseClient):
url: str = None,
cache_time: int = 0
):
"""Use this method to send answers to callback queries sent from inline keyboards.
"""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.
Parameters:

View File

@ -34,7 +34,7 @@ class AnswerInlineQuery(BaseClient):
switch_pm_text: str = "",
switch_pm_parameter: str = ""
):
"""Use this method to send answers to an inline query.
"""Send answers to an inline query.
No more than 50 results per query are allowed.
Parameters:

View File

@ -30,7 +30,7 @@ class GetGameHighScores(BaseClient):
chat_id: Union[int, str],
message_id: int = None
) -> "pyrogram.GameHighScores":
"""Use this method to get data for high score tables.
"""Get data for high score tables.
Parameters:
user_id (``int`` | ``str``):

View File

@ -32,7 +32,7 @@ class GetInlineBotResults(BaseClient):
latitude: float = None,
longitude: float = None
):
"""Use this method to get bot results via inline queries.
"""Get bot results via inline queries.
You can then send a result using :obj:`send_inline_bot_result <pyrogram.Client.send_inline_bot_result>`
Parameters:

View File

@ -30,7 +30,7 @@ class RequestCallbackAnswer(BaseClient):
callback_data: bytes,
timeout: int = 10
):
"""Use this method to request a callback answer from bots.
"""Request a callback answer from bots.
This is the equivalent of clicking an inline button containing callback data.
Parameters:

View File

@ -37,7 +37,7 @@ class SendGame(BaseClient):
"pyrogram.ForceReply"
] = None
) -> "pyrogram.Message":
"""Use this method to send a game.
"""Send a game.
Parameters:
chat_id (``int`` | ``str``):

View File

@ -32,7 +32,7 @@ class SendInlineBotResult(BaseClient):
reply_to_message_id: int = None,
hide_via: bool = None
):
"""Use this method to send an inline bot result.
"""Send an inline bot result.
Bot results can be retrieved using :obj:`get_inline_bot_results <pyrogram.Client.get_inline_bot_results>`
Parameters:

View File

@ -34,7 +34,7 @@ class SetGameScore(BaseClient):
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.
"""Set the score of the specified user in a game.
Parameters:
user_id (``int`` | ``str``):

View File

@ -27,7 +27,7 @@ class DeleteChatPhoto(BaseClient):
self,
chat_id: Union[int, str]
) -> bool:
"""Use this method to delete a chat photo.
"""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.

View File

@ -27,7 +27,7 @@ class ExportChatInviteLink(BaseClient):
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.
"""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.

View File

@ -28,7 +28,7 @@ class GetChat(BaseClient):
self,
chat_id: Union[int, str]
) -> "pyrogram.Chat":
"""Use this method to get up to date information about the chat.
"""Get up to date information about the chat.
Information include current name of the user for one-on-one conversations, current username of a user, group or
channel, etc.

View File

@ -30,7 +30,7 @@ class GetChatMember(BaseClient):
chat_id: Union[int, str],
user_id: Union[int, str]
) -> "pyrogram.ChatMember":
"""Use this method to get information about one member of a chat.
"""Get information about one member of a chat.
Parameters:
chat_id (``int`` | ``str``):

View File

@ -46,7 +46,7 @@ class GetChatMembers(BaseClient):
query: str = "",
filter: str = Filters.ALL
) -> "pyrogram.ChatMembers":
"""Use this method to get a chunk of the members list of a chat.
"""Get a chunk of the members list of a chat.
You can get up to 200 chat members at once.
A chat can be either a basic group, a supergroup or a channel.

View File

@ -27,7 +27,7 @@ class GetChatMembersCount(BaseClient):
self,
chat_id: Union[int, str]
) -> int:
"""Use this method to get the number of members in a chat.
"""Get the number of members in a chat.
Parameters:
chat_id (``int`` | ``str``):

View File

@ -26,7 +26,7 @@ class GetChatPreview(BaseClient):
self,
invite_link: str
):
"""Use this method to get the preview of a chat using the invite link.
"""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`

View File

@ -34,7 +34,7 @@ class GetDialogs(BaseClient):
limit: int = 100,
pinned_only: bool = False
) -> "pyrogram.Dialogs":
"""Use this method to get a chunk of the user's dialogs.
"""Get a chunk of the user's dialogs.
You can get up to 100 dialogs at once.
For a more convenient way of getting a user's dialogs see :meth:`iter_dialogs`.

View File

@ -22,7 +22,7 @@ from ...ext import BaseClient
class GetDialogsCount(BaseClient):
def get_dialogs_count(self, pinned_only: bool = False) -> int:
"""Use this method to get the total count of your dialogs.
"""Get the total count of your dialogs.
pinned_only (``bool``, *optional*):
Pass True if you want to count only pinned dialogs.

View File

@ -45,7 +45,7 @@ class IterChatMembers(BaseClient):
query: str = "",
filter: str = Filters.ALL
) -> Generator["pyrogram.ChatMember", None, None]:
"""Use this method to iterate through the members of a chat sequentially.
"""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
from the hassle of setting up boilerplate code. It is useful for getting the whole members list of a chat with

View File

@ -28,7 +28,7 @@ class IterDialogs(BaseClient):
offset_date: int = 0,
limit: int = 0
) -> Generator["pyrogram.Dialog", None, None]:
"""Use this method to iterate through a user's dialogs sequentially.
"""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
the hassle of setting up boilerplate code. It is useful for getting the whole dialogs list with a single call.

View File

@ -26,7 +26,7 @@ class JoinChat(BaseClient):
self,
chat_id: str
):
"""Use this method to join a group chat or channel.
"""Join a group chat or channel.
Parameters:
chat_id (``str``):

View File

@ -30,7 +30,7 @@ class KickChatMember(BaseClient):
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.
"""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
have the appropriate admin rights.

View File

@ -28,7 +28,7 @@ class LeaveChat(BaseClient):
chat_id: Union[int, str],
delete: bool = False
):
"""Use this method to leave a group chat or channel.
"""Leave a group chat or channel.
Parameters:
chat_id (``int`` | ``str``):

View File

@ -29,7 +29,7 @@ class PinChatMessage(BaseClient):
message_id: int,
disable_notification: bool = None
) -> bool:
"""Use this method to pin a message in a group, channel or your own chat.
"""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.

View File

@ -36,7 +36,7 @@ class PromoteChatMember(BaseClient):
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.
"""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.
Pass False for all boolean parameters to demote a user.

View File

@ -36,7 +36,7 @@ class RestrictChat(BaseClient):
can_invite_users: bool = False,
can_pin_messages: bool = False
) -> Chat:
"""Use this method to restrict a chat.
"""Restrict a chat.
Pass True for all boolean parameters to lift restrictions from a chat.
Parameters:

View File

@ -38,7 +38,7 @@ class RestrictChatMember(BaseClient):
can_invite_users: bool = False,
can_pin_messages: bool = False
) -> Chat:
"""Use this method to restrict a user in a supergroup.
"""Restrict a user in a supergroup.
The bot must be an administrator in the supergroup for this to work and must have the appropriate admin rights.
Pass True for all boolean parameters to lift restrictions from a user.

View File

@ -28,7 +28,7 @@ class SetChatDescription(BaseClient):
chat_id: Union[int, str],
description: str
) -> bool:
"""Use this method to change the description of a supergroup or a channel.
"""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.
Parameters:

View File

@ -31,7 +31,7 @@ class SetChatPhoto(BaseClient):
chat_id: Union[int, str],
photo: str
) -> bool:
"""Use this method to set a new profile photo for the chat.
"""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.

View File

@ -28,7 +28,7 @@ class SetChatTitle(BaseClient):
chat_id: Union[int, str],
title: str
) -> bool:
"""Use this method to change the title of a chat.
"""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.

View File

@ -28,7 +28,7 @@ class UnbanChatMember(BaseClient):
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.
"""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.

View File

@ -27,7 +27,7 @@ class UnpinChatMessage(BaseClient):
self,
chat_id: Union[int, str]
) -> bool:
"""Use this method to unpin a message in a group, channel or your own chat.
"""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.

View File

@ -28,7 +28,7 @@ class UpdateChatUsername(BaseClient):
chat_id: Union[int, str],
username: Union[str, None]
) -> bool:
"""Use this method to update a channel or a supergroup username.
"""Update a channel or a supergroup username.
To update your own username (for users only, not bots) you can use :meth:`update_username`.

View File

@ -28,7 +28,7 @@ class AddContacts(BaseClient):
self,
contacts: List["pyrogram.InputPhoneContact"]
):
"""Use this method to add contacts to your Telegram address book.
"""Add contacts to your Telegram address book.
Parameters:
contacts (List of :obj:`InputPhoneContact`):

View File

@ -28,7 +28,7 @@ class DeleteContacts(BaseClient):
self,
ids: List[int]
):
"""Use this method to delete contacts from your Telegram address book.
"""Delete contacts from your Telegram address book.
Parameters:
ids (List of ``int``):

View File

@ -30,7 +30,7 @@ log = logging.getLogger(__name__)
class GetContacts(BaseClient):
def get_contacts(self) -> List["pyrogram.User"]:
"""Use this method to get contacts from your Telegram address book.
"""Get contacts from your Telegram address book.
Returns:
List of :obj:`User`: On success, a list of users is returned.

View File

@ -22,7 +22,7 @@ from ...ext import BaseClient
class GetContactsCount(BaseClient):
def get_contacts_count(self) -> int:
"""Use this method to get the total count of contacts from your Telegram address book.
"""Get the total count of contacts from your Telegram address book.
Returns:
``int``: On success, an integer is returned.

View File

@ -29,7 +29,7 @@ class DeleteMessages(BaseClient):
message_ids: Iterable[int],
revoke: bool = True
) -> bool:
"""Use this method to delete messages, including service messages.
"""Delete messages, including service messages.
Parameters:
chat_id (``int`` | ``str``):

View File

@ -32,7 +32,7 @@ class DownloadMedia(BaseClient):
progress: callable = None,
progress_args: tuple = ()
) -> Union[str, None]:
"""Use this method to download the media from a message.
"""Download the media from a message.
Parameters:
message (:obj:`Message` | ``str``):

View File

@ -32,7 +32,7 @@ class EditMessageCaption(BaseClient):
parse_mode: str = "",
reply_markup: "pyrogram.InlineKeyboardMarkup" = None
) -> "pyrogram.Message":
"""Use this method to edit captions of messages.
"""Edit captions of messages.
Parameters:
chat_id (``int`` | ``str``):

View File

@ -40,7 +40,7 @@ class EditMessageMedia(BaseClient):
media: InputMedia,
reply_markup: "pyrogram.InlineKeyboardMarkup" = None
) -> "pyrogram.Message":
"""Use this method to edit audio, document, photo, or video messages.
"""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,
message type can be changed arbitrarily. When inline message is edited, new file can't be uploaded.

View File

@ -30,7 +30,7 @@ class EditMessageReplyMarkup(BaseClient):
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).
"""Edit only the reply markup of messages sent by the bot or via the bot (for inline bots).
Parameters:
chat_id (``int`` | ``str``):

View File

@ -33,7 +33,7 @@ class EditMessageText(BaseClient):
disable_web_page_preview: bool = None,
reply_markup: "pyrogram.InlineKeyboardMarkup" = None
) -> "pyrogram.Message":
"""Use this method to edit text messages.
"""Edit text messages.
Parameters:
chat_id (``int`` | ``str``):

View File

@ -33,7 +33,7 @@ class ForwardMessages(BaseClient):
as_copy: bool = False,
remove_caption: bool = False
) -> "pyrogram.Messages":
"""Use this method to forward messages of any kind.
"""Forward messages of any kind.
Parameters:
chat_id (``int`` | ``str``):

View File

@ -38,7 +38,7 @@ class GetHistory(BaseClient):
offset_date: int = 0,
reverse: bool = False
) -> "pyrogram.Messages":
"""Use this method to retrieve a chunk of the history of a chat.
"""Retrieve a chunk of the history of a chat.
You can get up to 100 messages at once.
For a more convenient way of getting a chat history see :meth:`iter_history`.

View File

@ -32,7 +32,7 @@ class GetHistoryCount(BaseClient):
self,
chat_id: Union[int, str]
) -> int:
"""Use this method to get the total count of messages in a chat.
"""Get the total count of messages in a chat.
.. note::

View File

@ -36,7 +36,7 @@ class GetMessages(BaseClient):
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.
"""Get one or more messages that belong to a specific chat.
You can retrieve up to 200 messages at once.
Parameters:

View File

@ -32,7 +32,7 @@ class IterHistory(BaseClient):
offset_date: int = 0,
reverse: bool = False
) -> Generator["pyrogram.Message", None, None]:
"""Use this method to iterate through a chat history sequentially.
"""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
the hassle of setting up boilerplate code. It is useful for getting the whole chat history with a single call.

View File

@ -29,7 +29,7 @@ class RetractVote(BaseClient):
chat_id: Union[int, str],
message_id: int
) -> "pyrogram.Poll":
"""Use this method to retract your vote in a poll.
"""Retract your vote in a poll.
Parameters:
chat_id (``int`` | ``str``):

View File

@ -49,7 +49,7 @@ class SendAnimation(BaseClient):
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).
"""Send animation files (animation or H.264/MPEG-4 AVC video without sound).
Parameters:
chat_id (``int`` | ``str``):

View File

@ -49,7 +49,7 @@ class SendAudio(BaseClient):
progress: callable = None,
progress_args: tuple = ()
) -> Union["pyrogram.Message", None]:
"""Use this method to send audio files.
"""Send audio files.
For sending voice messages, use the :obj:`send_voice()` method instead.

View File

@ -42,7 +42,7 @@ class SendCachedMedia(BaseClient):
"pyrogram.ForceReply"
] = None
) -> Union["pyrogram.Message", None]:
"""Use this method to send any media stored on the Telegram servers using a file_id.
"""Send any media stored on the Telegram servers using a file_id.
This convenience method works with any valid file_id only.
It does the same as calling the relevant method for sending media using a file_id, thus saving you from the

View File

@ -44,7 +44,7 @@ POSSIBLE_VALUES = list(map(lambda x: x.lower(), filter(lambda x: not x.startswit
class SendChatAction(BaseClient):
def send_chat_action(self, chat_id: Union[int, str], action: str) -> bool:
"""Use this method when you need to tell the other party that something is happening on your side.
"""Tell the other party that something is happening on your side.
Parameters:
chat_id (``int`` | ``str``):

View File

@ -40,7 +40,7 @@ class SendContact(BaseClient):
"pyrogram.ForceReply"
] = None
) -> "pyrogram.Message":
"""Use this method to send phone contacts.
"""Send phone contacts.
Parameters:
chat_id (``int`` | ``str``):

View File

@ -46,7 +46,7 @@ class SendDocument(BaseClient):
progress: callable = None,
progress_args: tuple = ()
) -> Union["pyrogram.Message", None]:
"""Use this method to send general files.
"""Send general files.
Parameters:
chat_id (``int`` | ``str``):

View File

@ -38,7 +38,7 @@ class SendLocation(BaseClient):
"pyrogram.ForceReply"
] = None
) -> "pyrogram.Message":
"""Use this method to send points on the map.
"""Send points on the map.
Parameters:
chat_id (``int`` | ``str``):

View File

@ -41,7 +41,7 @@ class SendMediaGroup(BaseClient):
disable_notification: bool = None,
reply_to_message_id: int = None
):
"""Use this method to send a group of photos or videos as an album.
"""Send a group of photos or videos as an album.
Parameters:
chat_id (``int`` | ``str``):

View File

@ -39,7 +39,7 @@ class SendMessage(BaseClient):
"pyrogram.ForceReply"
] = None
) -> "pyrogram.Message":
"""Use this method to send text messages.
"""Send text messages.
Parameters:
chat_id (``int`` | ``str``):

View File

@ -46,7 +46,7 @@ class SendPhoto(BaseClient):
progress: callable = None,
progress_args: tuple = ()
) -> Union["pyrogram.Message", None]:
"""Use this method to send photos.
"""Send photos.
Parameters:
chat_id (``int`` | ``str``):

View File

@ -38,7 +38,7 @@ class SendPoll(BaseClient):
"pyrogram.ForceReply"
] = None
) -> "pyrogram.Message":
"""Use this method to send a new poll.
"""Send a new poll.
Parameters:
chat_id (``int`` | ``str``):

View File

@ -43,7 +43,7 @@ class SendSticker(BaseClient):
progress: callable = None,
progress_args: tuple = ()
) -> Union["pyrogram.Message", None]:
"""Use this method to send .webp stickers.
"""Send .webp stickers.
Parameters:
chat_id (``int`` | ``str``):

View File

@ -42,7 +42,7 @@ class SendVenue(BaseClient):
"pyrogram.ForceReply"
] = None
) -> "pyrogram.Message":
"""Use this method to send information about a venue.
"""Send information about a venue.
Parameters:
chat_id (``int`` | ``str``):

View File

@ -50,7 +50,7 @@ class SendVideo(BaseClient):
progress: callable = None,
progress_args: tuple = ()
) -> Union["pyrogram.Message", None]:
"""Use this method to send video files.
"""Send video files.
Parameters:
chat_id (``int`` | ``str``):

View File

@ -46,7 +46,7 @@ class SendVideoNote(BaseClient):
progress: callable = None,
progress_args: tuple = ()
) -> Union["pyrogram.Message", None]:
"""Use this method to send video messages.
"""Send video messages.
Parameters:
chat_id (``int`` | ``str``):

View File

@ -46,7 +46,7 @@ class SendVoice(BaseClient):
progress: callable = None,
progress_args: tuple = ()
) -> Union["pyrogram.Message", None]:
"""Use this method to send audio files.
"""Send audio files.
Parameters:
chat_id (``int`` | ``str``):

View File

@ -30,7 +30,7 @@ class StopPoll(BaseClient):
message_id: int,
reply_markup: "pyrogram.InlineKeyboardMarkup" = None
) -> "pyrogram.Poll":
"""Use this method to stop a poll which was sent by you.
"""Stop a poll which was sent by you.
Stopped polls can't be reopened and nobody will be able to vote in it anymore.

View File

@ -30,7 +30,7 @@ class VotePoll(BaseClient):
message_id: id,
option: int
) -> "pyrogram.Poll":
"""Use this method to vote a poll.
"""Vote a poll.
Parameters:
chat_id (``int`` | ``str``):

View File

@ -30,7 +30,7 @@ class ChangeCloudPassword(BaseClient):
new_password: str,
new_hint: str = ""
) -> bool:
"""Use this method to change your Two-Step Verification password (Cloud Password) with a new one.
"""Change your Two-Step Verification password (Cloud Password) with a new one.
Parameters:
current_password (``str``):

View File

@ -30,7 +30,7 @@ class EnableCloudPassword(BaseClient):
hint: str = "",
email: str = None
) -> bool:
"""Use this method to enable the Two-Step Verification security feature (Cloud Password) on your account.
"""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.

View File

@ -26,7 +26,7 @@ class RemoveCloudPassword(BaseClient):
self,
password: str
) -> bool:
"""Use this method to turn off the Two-Step Verification security feature (Cloud Password) on your account.
"""Turn off the Two-Step Verification security feature (Cloud Password) on your account.
Parameters:
password (``str``):

View File

@ -29,7 +29,7 @@ class DeleteUserProfilePhotos(BaseClient):
self,
id: Union[str, List[str]]
) -> bool:
"""Use this method to delete your own profile photos.
"""Delete your own profile photos.
Parameters:
id (``str`` | ``list``):

View File

@ -23,7 +23,7 @@ from ...ext import BaseClient
class GetMe(BaseClient):
def get_me(self) -> "pyrogram.User":
"""A simple method for testing your authorization. Requires no parameters.
"""Get your own user identity.
Returns:
:obj:`User`: Basic information about the user or bot.

View File

@ -30,7 +30,7 @@ class GetUserProfilePhotos(BaseClient):
offset: int = 0,
limit: int = 100
) -> "pyrogram.UserProfilePhotos":
"""Use this method to get a list of profile pictures for a user.
"""Get a list of profile pictures for a user.
Parameters:
user_id (``int`` | ``str``):

View File

@ -24,7 +24,7 @@ from ...ext import BaseClient
class GetUserProfilePhotosCount(BaseClient):
def get_user_profile_photos_count(self, user_id: Union[int, str]) -> int:
"""Use this method to get the total count of profile pictures for a user.
"""Get the total count of profile pictures for a user.
Parameters:
user_id (``int`` | ``str``):

View File

@ -28,7 +28,7 @@ class GetUsers(BaseClient):
self,
user_ids: Union[Iterable[Union[int, str]], int, str]
) -> Union["pyrogram.User", List["pyrogram.User"]]:
"""Use this method to get information about a user.
"""Get information about a user.
You can retrieve up to 200 users at once.
Parameters:

View File

@ -25,7 +25,7 @@ class SetUserProfilePhoto(BaseClient):
self,
photo: str
) -> bool:
"""Use this method to set a new profile photo.
"""Set a new profile photo.
This method only works for Users.
Bots profile photos must be set using BotFather.

View File

@ -27,7 +27,7 @@ class UpdateUsername(BaseClient):
self,
username: Union[str, None]
) -> bool:
"""Use this method to update your own username.
"""Update your own username.
This method only works for users, not bots. Bot usernames must be changed via Bot Support or by recreating
them from scratch using BotFather. To update a channel or supergroup username you can use

View File

@ -28,7 +28,8 @@ from ..user_and_chats import User
class InlineQuery(PyrogramType, Update):
"""This object represents an incoming inline query.
"""An incoming inline query.
When the user sends an empty query, your bot could return some default or trending results.
Parameters:

View File

@ -40,7 +40,7 @@ from ..pyrogram_type import PyrogramType
class InlineQueryResult(PyrogramType):
"""This object represents one result of an inline query.
"""One result of an inline query.
Pyrogram currently supports results of the following 20 types:

View File

@ -23,7 +23,7 @@ from .inline_query_result import InlineQueryResult
class InlineQueryResultArticle(InlineQueryResult):
"""Represents a link to an article or web page.
"""Link to an article or web page.
TODO: Hide url?

View File

@ -20,7 +20,9 @@ from ..pyrogram_type import PyrogramType
class InputMedia(PyrogramType):
"""This object represents the content of a media message to be sent. It should be one of:
"""Content of a media message to be sent.
It should be one of:
- :obj:`InputMediaAnimation`
- :obj:`InputMediaDocument`

View File

@ -20,7 +20,7 @@ from . import InputMedia
class InputMediaAnimation(InputMedia):
"""This object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound) to be sent.
"""An animation file (GIF or H.264/MPEG-4 AVC video without sound) to be sent inside an album.
Parameters:
media (``str``):

View File

@ -20,7 +20,8 @@ from . import InputMedia
class InputMediaAudio(InputMedia):
"""This object represents an audio to be sent inside an album.
"""An audio to be sent inside an album.
It is intended to be used with :obj:`send_media_group() <pyrogram.Client.send_media_group>`.
Parameters:

View File

@ -20,7 +20,7 @@ from . import InputMedia
class InputMediaDocument(InputMedia):
"""This object represents a general file to be sent.
"""A generic file to be sent inside an album.
Parameters:
media (``str``):

View File

@ -20,7 +20,7 @@ from . import InputMedia
class InputMediaPhoto(InputMedia):
"""This object represents a photo to be sent inside an album.
"""A photo to be sent inside an album.
It is intended to be used with :obj:`send_media_group() <pyrogram.Client.send_media_group>`.
Parameters:

View File

@ -20,7 +20,7 @@ from . import InputMedia
class InputMediaVideo(InputMedia):
"""This object represents a video to be sent inside an album.
"""A video to be sent inside an album.
It is intended to be used with :obj:`send_media_group() <pyrogram.Client.send_media_group>`.
Parameters:

View File

@ -22,7 +22,7 @@ from ..pyrogram_type import PyrogramType
class InputPhoneContact(PyrogramType):
"""This object represents a Phone Contact to be added in your Telegram address book.
"""A Phone Contact to be added in your Telegram address book.
It is intended to be used with :meth:`add_contacts() <pyrogram.Client.add_contacts>`
Parameters:

View File

@ -24,7 +24,7 @@ from ..pyrogram_type import PyrogramType
class InputMessageContent(PyrogramType):
"""This object represents the content of a message to be sent as a result of an inline query.
"""Content of a message to be sent as a result of an inline query.
Pyrogram currently supports the following 4 types:

View File

@ -22,7 +22,7 @@ from ...style import HTML, Markdown
class InputTextMessageContent(InputMessageContent):
"""This object represents the content of a text message to be sent as the result of an inline query.
"""Content of a text message to be sent as the result of an inline query.
Parameters:
message_text (``str``):

View File

@ -20,7 +20,7 @@ from ..pyrogram_type import PyrogramType
class CallbackGame(PyrogramType):
"""A placeholder, currently holds no information.
"""Placeholder, currently holds no information.
Use BotFather to set up your game.
"""

View File

@ -27,7 +27,8 @@ from ..user_and_chats import User
class CallbackQuery(PyrogramType, Update):
"""This object represents an incoming callback query from a callback button in an inline keyboard.
"""An incoming callback query from a callback button in an inline keyboard.
If the button that originated the query was attached to a message sent by the bot, the field message
will be present. If the button was attached to a message sent via the bot (in inline mode),
the field inline_message_id will be present. Exactly one of the fields data or game_short_name will be present.

View File

@ -21,7 +21,9 @@ from ..pyrogram_type import PyrogramType
class ForceReply(PyrogramType):
"""Upon receiving a message with this object, Telegram clients will display a reply interface to the user.
"""Object used to force clients to show a reply interface.
Upon receiving a message with this object, Telegram clients will display a reply interface to the user.
This acts as if the user has selected the bot's message and tapped "Reply".
This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to

View File

@ -24,7 +24,7 @@ from pyrogram.client.types.user_and_chats import User
class GameHighScore(PyrogramType):
"""This object represents one row of the high scores table for a game.
"""One row of the high scores table for a game.
Parameters:
user (:obj:`User`):

View File

@ -25,7 +25,7 @@ from .game_high_score import GameHighScore
class GameHighScores(PyrogramType):
"""This object represents the high scores table for a game.
"""The high scores table for a game.
Parameters:
total_count (``int``):

View File

@ -27,7 +27,9 @@ from ..pyrogram_type import PyrogramType
class InlineKeyboardButton(PyrogramType):
"""This object represents one button of an inline keyboard. You must use exactly one of the optional fields.
"""One button of an inline keyboard.
You must use exactly one of the optional fields.
Parameters:
text (``str``):

View File

@ -24,7 +24,7 @@ from ..pyrogram_type import PyrogramType
class InlineKeyboardMarkup(PyrogramType):
"""This object represents an inline keyboard that appears right next to the message it belongs to.
"""An inline keyboard that appears right next to the message it belongs to.
Parameters:
inline_keyboard (List of List of :obj:`InlineKeyboardButton`):

View File

@ -22,7 +22,7 @@ from ..pyrogram_type import PyrogramType
class KeyboardButton(PyrogramType):
"""This object represents one button of the reply keyboard.
"""One button of the reply keyboard.
For simple text buttons String can be used instead of this object to specify text of the button.
Optional fields are mutually exclusive.

View File

@ -25,7 +25,7 @@ from ..pyrogram_type import PyrogramType
class ReplyKeyboardMarkup(PyrogramType):
"""This object represents a custom keyboard with reply options.
"""A custom keyboard with reply options.
Parameters:
keyboard (List of List of :obj:`KeyboardButton`):

View File

@ -21,9 +21,12 @@ from ..pyrogram_type import PyrogramType
class ReplyKeyboardRemove(PyrogramType):
"""Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard.
By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time
keyboards that are hidden immediately after the user presses a button (see ReplyKeyboardMarkup).
"""Object used to tell clients to remove a bot keyboard.
Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display
the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot.
An exception is made for one-time keyboards that are hidden immediately after the user presses a button
(see ReplyKeyboardMarkup).
Parameters:
selective (``bool``, *optional*):

Some files were not shown because too many files have changed in this diff Show More