mirror of
https://github.com/pyrogram/pyrogram
synced 2025-09-03 07:45:14 +00:00
Reword some method return type docstrings
This commit is contained in:
@@ -73,7 +73,7 @@ class AnswerInlineQuery(BaseClient):
|
||||
where they wanted to use the bot's inline capabilities.
|
||||
|
||||
Returns:
|
||||
``bool``: On success, True is returned.
|
||||
``bool``: True, on success.
|
||||
|
||||
Raises:
|
||||
RPCError: In case of a Telegram RPC error.
|
||||
|
@@ -58,7 +58,7 @@ class SendInlineBotResult(BaseClient):
|
||||
Sends the message with *via @bot* hidden.
|
||||
|
||||
Returns:
|
||||
On success, the sent Message is returned.
|
||||
:obj:`Message`: On success, the sent inline result message is returned.
|
||||
|
||||
Raises:
|
||||
RPCError: In case of a Telegram RPC error.
|
||||
|
@@ -32,7 +32,7 @@ class SetGameScore(BaseClient):
|
||||
disable_edit_message: bool = None,
|
||||
chat_id: Union[int, str] = None,
|
||||
message_id: int = None
|
||||
):
|
||||
) -> Union["pyrogram.Message", bool]:
|
||||
# inline_message_id: str = None): TODO Add inline_message_id
|
||||
"""Set the score of the specified user in a game.
|
||||
|
||||
@@ -63,8 +63,8 @@ class SetGameScore(BaseClient):
|
||||
Required if inline_message_id is not specified.
|
||||
|
||||
Returns:
|
||||
On success, if the message was sent by the bot, returns the edited :obj:`Message`,
|
||||
otherwise returns True.
|
||||
:obj:`Message` | ``bool``: On success, if the message was sent by the bot, the edited message is returned,
|
||||
True otherwise.
|
||||
|
||||
Raises:
|
||||
RPCError: In case of a Telegram RPC error.
|
||||
|
@@ -34,7 +34,7 @@ class GetChatMembersCount(BaseClient):
|
||||
Unique identifier (int) or username (str) of the target chat.
|
||||
|
||||
Returns:
|
||||
On success, an integer is returned.
|
||||
``int``: On success, the chat members count is returned.
|
||||
|
||||
Raises:
|
||||
RPCError: In case of a Telegram RPC error.
|
||||
|
@@ -29,7 +29,7 @@ class GetDialogsCount(BaseClient):
|
||||
Defaults to False.
|
||||
|
||||
Returns:
|
||||
``int``: On success, an integer is returned.
|
||||
``int``: On success, the dialogs count is returned.
|
||||
|
||||
Raises:
|
||||
RPCError: In case of a Telegram RPC error.
|
||||
|
@@ -54,9 +54,8 @@ class KickChatMember(BaseClient):
|
||||
considered to be banned forever. Defaults to 0 (ban forever).
|
||||
|
||||
Returns:
|
||||
:obj:`Message`: On success, a service message will be returned (when applicable).
|
||||
|
||||
``bool`` -- True, in case a message object couldn't be returned.
|
||||
:obj:`Message` | ``bool``: On success, a service message will be returned (when applicable), otherwise, in
|
||||
case a message object couldn't be returned, True is returned.
|
||||
|
||||
Raises:
|
||||
RPCError: In case of a Telegram RPC error.
|
||||
|
@@ -30,6 +30,7 @@ log = logging.getLogger(__name__)
|
||||
|
||||
class GetContacts(BaseClient):
|
||||
def get_contacts(self) -> List["pyrogram.User"]:
|
||||
# TODO: Create a Users object and return that
|
||||
"""Get contacts from your Telegram address book.
|
||||
|
||||
Returns:
|
||||
|
@@ -25,7 +25,7 @@ class GetContactsCount(BaseClient):
|
||||
"""Get the total count of contacts from your Telegram address book.
|
||||
|
||||
Returns:
|
||||
``int``: On success, an integer is returned.
|
||||
``int``: On success, the contacts count is returned.
|
||||
|
||||
Raises:
|
||||
RPCError: In case of a Telegram RPC error.
|
||||
|
@@ -73,9 +73,8 @@ class DownloadMedia(BaseClient):
|
||||
You can either keep *\*args* or add every single extra argument in your function signature.
|
||||
|
||||
Returns:
|
||||
``str``: On success, the absolute path of the downloaded file is returned.
|
||||
|
||||
``None`` -- In case the download is deliberately stopped with :meth:`stop_transmission`.
|
||||
``str`` | ``None``: On success, the absolute path of the downloaded file is returned, otherwise, in case
|
||||
the download failed or was deliberately stopped with :meth:`stop_transmission`, None is returned.
|
||||
|
||||
Raises:
|
||||
RPCError: In case of a Telegram RPC error.
|
||||
|
@@ -45,9 +45,8 @@ class EditMessageReplyMarkup(BaseClient):
|
||||
An InlineKeyboardMarkup object.
|
||||
|
||||
Returns:
|
||||
:obj:`Message`: In case the edited message is sent by the bot.
|
||||
|
||||
``bool`` -- True, in case the edited message is sent by the user.
|
||||
:obj:`Message` | ``bool``: In case the edited message is sent by the bot, the edited message is returned,
|
||||
otherwise, True is returned in case the edited message is send by the user.
|
||||
|
||||
Raises:
|
||||
RPCError: In case of a Telegram RPC error.
|
||||
|
@@ -64,11 +64,9 @@ class ForwardMessages(BaseClient):
|
||||
Defaults to False.
|
||||
|
||||
Returns:
|
||||
:obj:`Message`: In case *message_ids* was an integer, the single forwarded message is
|
||||
returned.
|
||||
|
||||
:obj:`Messages` -- In case *message_ids* was an iterable, the returned value will be an
|
||||
object containing a list of messages, even if such iterable contained just a single element.
|
||||
:obj:`Message` | :obj:`Messages`: In case *message_ids* was an integer, the single forwarded message is
|
||||
returned, otherwise, in case *message_ids* was an iterable, the returned value will be an object containing
|
||||
a list of messages, even if such iterable contained just a single element.
|
||||
|
||||
Raises:
|
||||
RPCError: In case of a Telegram RPC error.
|
||||
|
@@ -45,7 +45,7 @@ class GetHistoryCount(BaseClient):
|
||||
Unique identifier (int) or username (str) of the target chat.
|
||||
|
||||
Returns:
|
||||
``int``: On success, an integer is returned.
|
||||
``int``: On success, the chat history count is returned.
|
||||
|
||||
Raises:
|
||||
RPCError: In case of a Telegram RPC error.
|
||||
|
@@ -60,11 +60,9 @@ class GetMessages(BaseClient):
|
||||
Defaults to 1.
|
||||
|
||||
Returns:
|
||||
:obj:`Message`: In case *message_ids* was an integer, the single forwarded message is
|
||||
returned.
|
||||
|
||||
:obj:`Messages` -- In case *message_ids* was an iterable, the returned value will be an
|
||||
object containing a list of messages, even if such iterable contained just a single element.
|
||||
:obj:`Message` | :obj:`Messages`: In case *message_ids* was an integer, the single requested message is
|
||||
returned, otherwise, in case *message_ids* was an iterable, the returned value will be an object containing
|
||||
a list of messages, even if such iterable contained just a single element.
|
||||
|
||||
Raises:
|
||||
RPCError: In case of a Telegram RPC error.
|
||||
|
@@ -120,9 +120,8 @@ class SendAnimation(BaseClient):
|
||||
You can either keep *\*args* or add every single extra argument in your function signature.
|
||||
|
||||
Returns:
|
||||
:obj:`Message`: On success, the sent animation message is returned.
|
||||
|
||||
``None`` -- In case the upload is deliberately stopped with :meth:`stop_transmission`.
|
||||
:obj:`Message` | ``None``: On success, the sent animation message is returned, otherwise, in case the upload
|
||||
is deliberately stopped with :meth:`stop_transmission`, None is returned.
|
||||
|
||||
Raises:
|
||||
RPCError: In case of a Telegram RPC error.
|
||||
|
@@ -122,9 +122,8 @@ class SendAudio(BaseClient):
|
||||
You can either keep *\*args* or add every single extra argument in your function signature.
|
||||
|
||||
Returns:
|
||||
:obj:`Message`: On success, the sent audio message is returned.
|
||||
|
||||
``None`` -- In case the upload is deliberately stopped with :meth:`stop_transmission`.
|
||||
:obj:`Message` | ``None``: On success, the sent audio message is returned, otherwise, in case the upload
|
||||
is deliberately stopped with :meth:`stop_transmission`, None is returned.
|
||||
|
||||
Raises:
|
||||
RPCError: In case of a Telegram RPC error.
|
||||
|
@@ -108,9 +108,8 @@ class SendDocument(BaseClient):
|
||||
You can either keep *\*args* or add every single extra argument in your function signature.
|
||||
|
||||
Returns:
|
||||
:obj:`Message`: On success, the sent document message is returned.
|
||||
|
||||
``None`` -- In case the upload is deliberately stopped with :meth:`stop_transmission`.
|
||||
:obj:`Message` | ``None``: On success, the sent document message is returned, otherwise, in case the upload
|
||||
is deliberately stopped with :meth:`stop_transmission`, None is returned.
|
||||
|
||||
Raises:
|
||||
RPCError: In case of a Telegram RPC error.
|
||||
|
@@ -107,9 +107,8 @@ class SendPhoto(BaseClient):
|
||||
You can either keep *\*args* or add every single extra argument in your function signature.
|
||||
|
||||
Returns:
|
||||
:obj:`Message`: On success, the sent photo message is returned.
|
||||
|
||||
``None`` -- In case the upload is deliberately stopped with :meth:`stop_transmission`.
|
||||
:obj:`Message` | ``None``: On success, the sent photo message is returned, otherwise, in case the upload
|
||||
is deliberately stopped with :meth:`stop_transmission`, None is returned.
|
||||
|
||||
Raises:
|
||||
RPCError: In case of a Telegram RPC error.
|
||||
|
@@ -92,10 +92,8 @@ class SendSticker(BaseClient):
|
||||
You can either keep *\*args* or add every single extra argument in your function signature.
|
||||
|
||||
Returns:
|
||||
:obj:`Message`: On success, the sent sticker message is returned.
|
||||
|
||||
``None`` -- In case the upload is deliberately stopped with :meth:`stop_transmission`.
|
||||
|
||||
:obj:`Message` | ``None``: On success, the sent sticker message is returned, otherwise, in case the upload
|
||||
is deliberately stopped with :meth:`stop_transmission`, None is returned.
|
||||
Raises:
|
||||
RPCError: In case of a Telegram RPC error.
|
||||
"""
|
||||
|
@@ -124,9 +124,8 @@ class SendVideo(BaseClient):
|
||||
You can either keep *\*args* or add every single extra argument in your function signature.
|
||||
|
||||
Returns:
|
||||
:obj:`Message`: On success, the sent video message is returned.
|
||||
|
||||
``None`` -- In case the upload is deliberately stopped with :meth:`stop_transmission`.
|
||||
:obj:`Message` | ``None``: On success, the sent video message is returned, otherwise, in case the upload
|
||||
is deliberately stopped with :meth:`stop_transmission`, None is returned.
|
||||
|
||||
Raises:
|
||||
RPCError: In case of a Telegram RPC error.
|
||||
|
@@ -107,9 +107,8 @@ class SendVideoNote(BaseClient):
|
||||
You can either keep *\*args* or add every single extra argument in your function signature.
|
||||
|
||||
Returns:
|
||||
:obj:`Message`: On success, the sent video note message is returned.
|
||||
|
||||
``None`` -- In case the upload is deliberately stopped with :meth:`stop_transmission`.
|
||||
:obj:`Message` | ``None``: On success, the sent video note message is returned, otherwise, in case the
|
||||
pload is deliberately stopped with :meth:`stop_transmission`, None is returned.
|
||||
|
||||
Raises:
|
||||
RPCError: In case of a Telegram RPC error.
|
||||
|
@@ -105,9 +105,8 @@ class SendVoice(BaseClient):
|
||||
You can either keep *\*args* or add every single extra argument in your function signature.
|
||||
|
||||
Returns:
|
||||
:obj:`Message`: On success, the sent voice message is returned.
|
||||
|
||||
``None`` -- In case the upload is deliberately stopped with :meth:`stop_transmission`.
|
||||
:obj:`Message` | ``None``: On success, the sent voice message is returned, otherwise, in case the upload
|
||||
is deliberately stopped with :meth:`stop_transmission`, None is returned.
|
||||
|
||||
Raises:
|
||||
RPCError: In case of a Telegram RPC error.
|
||||
|
@@ -33,7 +33,7 @@ class GetUserProfilePhotosCount(BaseClient):
|
||||
For a contact that exists in your Telegram address book you can use his phone number (str).
|
||||
|
||||
Returns:
|
||||
``int``: On success, an integer is returned.
|
||||
``int``: On success, the user profile photos count is returned.
|
||||
|
||||
Raises:
|
||||
RPCError: In case of a Telegram RPC error.
|
||||
|
@@ -24,6 +24,7 @@ from ...ext import BaseClient
|
||||
|
||||
|
||||
class GetUsers(BaseClient):
|
||||
# TODO: Add Users type and use that
|
||||
def get_users(
|
||||
self,
|
||||
user_ids: Union[Iterable[Union[int, str]], int, str]
|
||||
@@ -38,9 +39,9 @@ class GetUsers(BaseClient):
|
||||
Iterators and Generators are also accepted.
|
||||
|
||||
Returns:
|
||||
:obj:`User`: In case *user_ids* was an integer or string.
|
||||
|
||||
List of :obj:`User` -- In case *user_ids* was an iterable, even if the iterable contained one item only.
|
||||
:obj:`User` | List of :obj:`User`: In case *user_ids* was an integer or string the single requested user is
|
||||
returned, otherwise, in case *user_ids* was an iterable a list of users is returned, even if the iterable
|
||||
contained one item only.
|
||||
|
||||
Raises:
|
||||
RPCError: In case of a Telegram RPC error.
|
||||
|
Reference in New Issue
Block a user