mirror of
https://github.com/pyrogram/pyrogram
synced 2025-09-01 14:55:12 +00:00
Refactor project and move errors namespace out from pyrogram.api
This commit is contained in:
@@ -335,7 +335,7 @@ def start():
|
|||||||
docstring_args = "Attributes:\n ID: ``{}``\n\n ".format(c.id) + docstring_args
|
docstring_args = "Attributes:\n ID: ``{}``\n\n ".format(c.id) + docstring_args
|
||||||
|
|
||||||
if c.section == "functions":
|
if c.section == "functions":
|
||||||
docstring_args += "\n\n Raises:\n :obj:`Error <pyrogram.Error>`"
|
docstring_args += "\n\n Raises:\n :obj:`RPCError <pyrogram.RPCError>`"
|
||||||
docstring_args += "\n\n Returns:\n " + get_docstring_arg_type(c.return_type)
|
docstring_args += "\n\n Returns:\n " + get_docstring_arg_type(c.return_type)
|
||||||
else:
|
else:
|
||||||
references = get_references(".".join(filter(None, [c.namespace, c.name])))
|
references = get_references(".".join(filter(None, [c.namespace, c.name])))
|
||||||
|
@@ -22,7 +22,7 @@ import re
|
|||||||
import shutil
|
import shutil
|
||||||
|
|
||||||
HOME = "compiler/error"
|
HOME = "compiler/error"
|
||||||
DEST = "pyrogram/api/errors/exceptions"
|
DEST = "pyrogram/errors/exceptions"
|
||||||
NOTICE_PATH = "NOTICE"
|
NOTICE_PATH = "NOTICE"
|
||||||
|
|
||||||
|
|
||||||
@@ -134,7 +134,7 @@ def start():
|
|||||||
|
|
||||||
if "__main__" == __name__:
|
if "__main__" == __name__:
|
||||||
HOME = "."
|
HOME = "."
|
||||||
DEST = "../../pyrogram/api/errors/exceptions"
|
DEST = "../../pyrogram/errors/exceptions"
|
||||||
NOTICE_PATH = "../../NOTICE"
|
NOTICE_PATH = "../../NOTICE"
|
||||||
|
|
||||||
start()
|
start()
|
||||||
|
@@ -1,12 +1,12 @@
|
|||||||
{notice}
|
{notice}
|
||||||
|
|
||||||
from ..error import Error
|
from ..rpc_error import RPCError
|
||||||
|
|
||||||
|
|
||||||
class {super_class}(Error):
|
class {super_class}(RPCError):
|
||||||
{docstring}
|
{docstring}
|
||||||
CODE = {code}
|
CODE = {code}
|
||||||
"""``int``: Error Code"""
|
"""``int``: RPC Error Code"""
|
||||||
NAME = __doc__
|
NAME = __doc__
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
class {sub_class}({super_class}):
|
class {sub_class}({super_class}):
|
||||||
{docstring}
|
{docstring}
|
||||||
ID = {id}
|
ID = {id}
|
||||||
"""``str``: Error ID"""
|
"""``str``: RPC Error ID"""
|
||||||
MESSAGE = __doc__
|
MESSAGE = __doc__
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,8 +1,7 @@
|
|||||||
400 - Bad Request
|
400 - Bad Request
|
||||||
=================
|
=================
|
||||||
|
|
||||||
.. module:: pyrogram.api.errors.BadRequest
|
.. module:: pyrogram.errors.BadRequest
|
||||||
|
|
||||||
.. automodule:: pyrogram.api.errors.exceptions.bad_request_400
|
.. automodule:: pyrogram.errors.exceptions.bad_request_400
|
||||||
:members:
|
:members:
|
||||||
:show-inheritance:
|
|
||||||
|
@@ -1,8 +1,7 @@
|
|||||||
420 - Flood
|
420 - Flood
|
||||||
===========
|
===========
|
||||||
|
|
||||||
.. module:: pyrogram.api.errors.Flood
|
.. module:: pyrogram.errors.Flood
|
||||||
|
|
||||||
.. automodule:: pyrogram.api.errors.exceptions.flood_420
|
.. automodule:: pyrogram.errors.exceptions.flood_420
|
||||||
:members:
|
:members:
|
||||||
:show-inheritance:
|
|
||||||
|
@@ -1,8 +1,7 @@
|
|||||||
403 - Forbidden
|
403 - Forbidden
|
||||||
===============
|
===============
|
||||||
|
|
||||||
.. module:: pyrogram.api.errors.Forbidden
|
.. module:: pyrogram.errors.Forbidden
|
||||||
|
|
||||||
.. automodule:: pyrogram.api.errors.exceptions.forbidden_403
|
.. automodule:: pyrogram.errors.exceptions.forbidden_403
|
||||||
:members:
|
:members:
|
||||||
:show-inheritance:
|
|
||||||
|
@@ -1,8 +1,7 @@
|
|||||||
500 - Internal Server Error
|
500 - Internal Server Error
|
||||||
===========================
|
===========================
|
||||||
|
|
||||||
.. module:: pyrogram.api.errors.InternalServerError
|
.. module:: pyrogram.errors.InternalServerError
|
||||||
|
|
||||||
.. automodule:: pyrogram.api.errors.exceptions.internal_server_error_500
|
.. automodule:: pyrogram.errors.exceptions.internal_server_error_500
|
||||||
:members:
|
:members:
|
||||||
:show-inheritance:
|
|
||||||
|
@@ -1,8 +1,7 @@
|
|||||||
406 - Not Acceptable
|
406 - Not Acceptable
|
||||||
====================
|
====================
|
||||||
|
|
||||||
.. module:: pyrogram.api.errors.NotAcceptable
|
.. module:: pyrogram.errors.NotAcceptable
|
||||||
|
|
||||||
.. automodule:: pyrogram.api.errors.exceptions.not_acceptable_406
|
.. automodule:: pyrogram.errors.exceptions.not_acceptable_406
|
||||||
:members:
|
:members:
|
||||||
:show-inheritance:
|
|
||||||
|
@@ -1,8 +1,7 @@
|
|||||||
303 - See Other
|
303 - See Other
|
||||||
===============
|
===============
|
||||||
|
|
||||||
.. module:: pyrogram.api.errors.SeeOther
|
.. module:: pyrogram.errors.SeeOther
|
||||||
|
|
||||||
.. automodule:: pyrogram.api.errors.exceptions.see_other_303
|
.. automodule:: pyrogram.errors.exceptions.see_other_303
|
||||||
:members:
|
:members:
|
||||||
:show-inheritance:
|
|
||||||
|
@@ -1,8 +1,7 @@
|
|||||||
401 - Unauthorized
|
401 - Unauthorized
|
||||||
==================
|
==================
|
||||||
|
|
||||||
.. module:: pyrogram.api.errors.Unauthorized
|
.. module:: pyrogram.errors.Unauthorized
|
||||||
|
|
||||||
.. automodule:: pyrogram.api.errors.exceptions.unauthorized_401
|
.. automodule:: pyrogram.errors.exceptions.unauthorized_401
|
||||||
:members:
|
:members:
|
||||||
:show-inheritance:
|
|
||||||
|
@@ -1,8 +1,7 @@
|
|||||||
520 - Unknown Error
|
520 - Unknown Error
|
||||||
===================
|
===================
|
||||||
|
|
||||||
.. module:: pyrogram.api.errors.UnknownError
|
.. module:: pyrogram.errors.UnknownError
|
||||||
|
|
||||||
.. autoexception:: pyrogram.api.errors.error.UnknownError
|
.. autoexception:: pyrogram.errors.rpc_error.UnknownError
|
||||||
:members:
|
:members:
|
||||||
:show-inheritance:
|
|
||||||
|
@@ -1,9 +1,8 @@
|
|||||||
Error
|
RPCError
|
||||||
=====
|
========
|
||||||
|
|
||||||
.. autoexception:: pyrogram.Error
|
.. autoexception:: pyrogram.RPCError
|
||||||
:members:
|
:members:
|
||||||
:show-inheritance:
|
|
||||||
|
|
||||||
.. toctree::
|
.. toctree::
|
||||||
../errors/SeeOther
|
../errors/SeeOther
|
@@ -15,6 +15,6 @@ after the well established `Telegram Bot API`_ methods, thus offering a familiar
|
|||||||
Filters
|
Filters
|
||||||
ChatAction
|
ChatAction
|
||||||
ParseMode
|
ParseMode
|
||||||
Error
|
RPCError
|
||||||
|
|
||||||
.. _Telegram Bot API: https://core.telegram.org/bots/api#available-methods
|
.. _Telegram Bot API: https://core.telegram.org/bots/api#available-methods
|
||||||
|
@@ -18,34 +18,19 @@
|
|||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
__version__ = "0.12.0.develop"
|
||||||
|
__license__ = "GNU Lesser General Public License v3 or later (LGPLv3+)"
|
||||||
|
__copyright__ = "Copyright (C) 2017-2019 Dan Tès <https://github.com/delivrance>".replace(
|
||||||
|
"\xe8", "e" if sys.getfilesystemencoding() != "utf-8" else "\xe8"
|
||||||
|
)
|
||||||
|
|
||||||
|
from .errors import RPCError
|
||||||
|
from .client import *
|
||||||
|
from .client.handlers import *
|
||||||
|
from .client.types import *
|
||||||
|
|
||||||
if sys.version_info[:3] in [(3, 5, 0), (3, 5, 1), (3, 5, 2)]:
|
if sys.version_info[:3] in [(3, 5, 0), (3, 5, 1), (3, 5, 2)]:
|
||||||
from .vendor import typing
|
from .vendor import typing
|
||||||
|
|
||||||
# Monkey patch the standard "typing" module because Python versions from 3.5.0 to 3.5.2 have a broken one.
|
# Monkey patch the standard "typing" module because Python versions from 3.5.0 to 3.5.2 have a broken one.
|
||||||
sys.modules["typing"] = typing
|
sys.modules["typing"] = typing
|
||||||
|
|
||||||
__copyright__ = "Copyright (C) 2017-2019 Dan Tès <https://github.com/delivrance>".replace(
|
|
||||||
"\xe8",
|
|
||||||
"e" if sys.getfilesystemencoding() != "utf-8" else "\xe8"
|
|
||||||
)
|
|
||||||
__license__ = "GNU Lesser General Public License v3 or later (LGPLv3+)"
|
|
||||||
__version__ = "0.12.0.develop"
|
|
||||||
|
|
||||||
from .api.errors import Error
|
|
||||||
from .client.types import (
|
|
||||||
Audio, Chat, ChatMember, ChatMembers, ChatPhoto, Contact, Document, InputMedia, InputMediaPhoto,
|
|
||||||
InputMediaVideo, InputMediaDocument, InputMediaAudio, InputMediaAnimation, InputPhoneContact,
|
|
||||||
Location, Message, MessageEntity, Dialog, Dialogs, Photo, PhotoSize, Sticker, User, UserStatus,
|
|
||||||
UserProfilePhotos, Venue, Animation, Video, VideoNote, Voice, CallbackQuery, Messages, ForceReply,
|
|
||||||
InlineKeyboardButton, InlineKeyboardMarkup, KeyboardButton, ReplyKeyboardMarkup, ReplyKeyboardRemove,
|
|
||||||
InlineQuery, InlineQueryResult, InlineQueryResultArticle, InputMessageContent, InputTextMessageContent,
|
|
||||||
InlineKeyboardButton, InlineKeyboardMarkup, KeyboardButton, ReplyKeyboardMarkup, ReplyKeyboardRemove, Poll,
|
|
||||||
PollOption, ChatPreview, StopPropagation, ContinuePropagation, Game, CallbackGame, GameHighScore, GameHighScores,
|
|
||||||
ChatPermissions
|
|
||||||
)
|
|
||||||
from .client import (
|
|
||||||
Client, ChatAction, ParseMode, Emoji,
|
|
||||||
MessageHandler, DeletedMessagesHandler, CallbackQueryHandler,
|
|
||||||
RawUpdateHandler, DisconnectHandler, UserStatusHandler, Filters,
|
|
||||||
InlineQueryHandler
|
|
||||||
)
|
|
||||||
|
@@ -39,18 +39,9 @@ class Object:
|
|||||||
def __str__(self) -> str:
|
def __str__(self) -> str:
|
||||||
return dumps(self, indent=4, default=default, ensure_ascii=False)
|
return dumps(self, indent=4, default=default, ensure_ascii=False)
|
||||||
|
|
||||||
def __bool__(self) -> bool:
|
|
||||||
return True
|
|
||||||
|
|
||||||
def __eq__(self, other) -> bool:
|
|
||||||
return self.__dict__ == other.__dict__
|
|
||||||
|
|
||||||
def __len__(self) -> int:
|
def __len__(self) -> int:
|
||||||
return len(self.write())
|
return len(self.write())
|
||||||
|
|
||||||
def __call__(self):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def __getitem__(self, item):
|
def __getitem__(self, item):
|
||||||
return getattr(self, item)
|
return getattr(self, item)
|
||||||
|
|
||||||
|
@@ -19,9 +19,7 @@
|
|||||||
from .client import Client
|
from .client import Client
|
||||||
from .ext import BaseClient, ChatAction, Emoji, ParseMode
|
from .ext import BaseClient, ChatAction, Emoji, ParseMode
|
||||||
from .filters import Filters
|
from .filters import Filters
|
||||||
from .handlers import (
|
|
||||||
MessageHandler, DeletedMessagesHandler,
|
__all__ = [
|
||||||
CallbackQueryHandler, RawUpdateHandler,
|
"Client", "BaseClient", "ChatAction", "Emoji", "ParseMode", "Filters",
|
||||||
DisconnectHandler, UserStatusHandler,
|
]
|
||||||
InlineQueryHandler
|
|
||||||
)
|
|
||||||
|
@@ -41,7 +41,7 @@ from typing import Union, List
|
|||||||
|
|
||||||
from pyrogram.api import functions, types
|
from pyrogram.api import functions, types
|
||||||
from pyrogram.api.core import Object
|
from pyrogram.api.core import Object
|
||||||
from pyrogram.api.errors import (
|
from pyrogram.errors import (
|
||||||
PhoneMigrate, NetworkMigrate, PhoneNumberInvalid,
|
PhoneMigrate, NetworkMigrate, PhoneNumberInvalid,
|
||||||
PhoneNumberUnoccupied, PhoneCodeInvalid, PhoneCodeHashEmpty,
|
PhoneNumberUnoccupied, PhoneCodeInvalid, PhoneCodeHashEmpty,
|
||||||
PhoneCodeExpired, PhoneCodeEmpty, SessionPasswordNeeded,
|
PhoneCodeExpired, PhoneCodeEmpty, SessionPasswordNeeded,
|
||||||
@@ -54,8 +54,7 @@ from pyrogram.client.handlers.handler import Handler
|
|||||||
from pyrogram.client.methods.password.utils import compute_check
|
from pyrogram.client.methods.password.utils import compute_check
|
||||||
from pyrogram.crypto import AES
|
from pyrogram.crypto import AES
|
||||||
from pyrogram.session import Auth, Session
|
from pyrogram.session import Auth, Session
|
||||||
from .dispatcher import Dispatcher
|
from .ext import utils, Syncer, BaseClient, Dispatcher
|
||||||
from .ext import utils, Syncer, BaseClient
|
|
||||||
from .methods import Methods
|
from .methods import Methods
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
@@ -267,7 +266,7 @@ class Client(Methods, BaseClient):
|
|||||||
Requires no parameters.
|
Requires no parameters.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
``ConnectionError`` in case you try to start an already started Client.
|
``ConnectionError`` in case you try to start an already started Client.
|
||||||
"""
|
"""
|
||||||
if self.is_started:
|
if self.is_started:
|
||||||
@@ -437,7 +436,7 @@ class Client(Methods, BaseClient):
|
|||||||
Requires no parameters.
|
Requires no parameters.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
self.start()
|
self.start()
|
||||||
self.idle()
|
self.idle()
|
||||||
@@ -1039,7 +1038,7 @@ class Client(Methods, BaseClient):
|
|||||||
Timeout in seconds.
|
Timeout in seconds.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
if not self.is_started:
|
if not self.is_started:
|
||||||
raise ConnectionError("Client has not been started")
|
raise ConnectionError("Client has not been started")
|
||||||
@@ -1329,7 +1328,7 @@ class Client(Methods, BaseClient):
|
|||||||
On success, the resolved peer id is returned in form of an InputPeer object.
|
On success, the resolved peer id is returned in form of an InputPeer object.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
``KeyError`` in case the peer doesn't exist in the internal database.
|
``KeyError`` in case the peer doesn't exist in the internal database.
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
@@ -1434,7 +1433,7 @@ class Client(Methods, BaseClient):
|
|||||||
On success, the uploaded file is returned in form of an InputFile object.
|
On success, the uploaded file is returned in form of an InputFile object.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
part_size = 512 * 1024
|
part_size = 512 * 1024
|
||||||
file_size = os.path.getsize(path)
|
file_size = os.path.getsize(path)
|
||||||
|
@@ -23,3 +23,8 @@ from .inline_query_handler import InlineQueryHandler
|
|||||||
from .message_handler import MessageHandler
|
from .message_handler import MessageHandler
|
||||||
from .raw_update_handler import RawUpdateHandler
|
from .raw_update_handler import RawUpdateHandler
|
||||||
from .user_status_handler import UserStatusHandler
|
from .user_status_handler import UserStatusHandler
|
||||||
|
|
||||||
|
__all__ = [
|
||||||
|
"MessageHandler", "DeletedMessagesHandler", "CallbackQueryHandler", "RawUpdateHandler", "DisconnectHandler",
|
||||||
|
"UserStatusHandler", "InlineQueryHandler"
|
||||||
|
]
|
||||||
|
@@ -57,7 +57,7 @@ class AnswerCallbackQuery(BaseClient):
|
|||||||
True, on success.
|
True, on success.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
return self.send(
|
return self.send(
|
||||||
functions.messages.SetBotCallbackAnswer(
|
functions.messages.SetBotCallbackAnswer(
|
||||||
|
@@ -52,7 +52,7 @@ class GetGameHighScores(BaseClient):
|
|||||||
On success, a :obj:`GameHighScores <pyrogram.GameHighScores>` object is returned.
|
On success, a :obj:`GameHighScores <pyrogram.GameHighScores>` object is returned.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
# TODO: inline_message_id
|
# TODO: inline_message_id
|
||||||
|
|
||||||
|
@@ -19,7 +19,7 @@
|
|||||||
from typing import Union
|
from typing import Union
|
||||||
|
|
||||||
from pyrogram.api import functions, types
|
from pyrogram.api import functions, types
|
||||||
from pyrogram.api.errors import UnknownError
|
from pyrogram.errors import UnknownError
|
||||||
from pyrogram.client.ext import BaseClient
|
from pyrogram.client.ext import BaseClient
|
||||||
|
|
||||||
|
|
||||||
@@ -58,7 +58,7 @@ class GetInlineBotResults(BaseClient):
|
|||||||
On Success, :obj:`BotResults <pyrogram.api.types.messages.BotResults>` is returned.
|
On Success, :obj:`BotResults <pyrogram.api.types.messages.BotResults>` is returned.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
``TimeoutError`` if the bot fails to answer within 10 seconds
|
``TimeoutError`` if the bot fails to answer within 10 seconds
|
||||||
"""
|
"""
|
||||||
# TODO: Don't return the raw type
|
# TODO: Don't return the raw type
|
||||||
|
@@ -49,7 +49,7 @@ class RequestCallbackAnswer(BaseClient):
|
|||||||
or as an alert.
|
or as an alert.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
``TimeoutError`` if the bot fails to answer within 10 seconds.
|
``TimeoutError`` if the bot fails to answer within 10 seconds.
|
||||||
"""
|
"""
|
||||||
return self.send(
|
return self.send(
|
||||||
|
@@ -63,7 +63,7 @@ class SendGame(BaseClient):
|
|||||||
On success, the sent :obj:`Message` is returned.
|
On success, the sent :obj:`Message` is returned.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
r = self.send(
|
r = self.send(
|
||||||
functions.messages.SendMedia(
|
functions.messages.SendMedia(
|
||||||
|
@@ -61,7 +61,7 @@ class SendInlineBotResult(BaseClient):
|
|||||||
On success, the sent Message is returned.
|
On success, the sent Message is returned.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
return self.send(
|
return self.send(
|
||||||
functions.messages.SendInlineBotResult(
|
functions.messages.SendInlineBotResult(
|
||||||
|
@@ -67,7 +67,7 @@ class SetGameScore(BaseClient):
|
|||||||
otherwise returns True.
|
otherwise returns True.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
:class:`BotScoreNotModified` if the new score is not greater than the user's current score in the chat and force is False.
|
:class:`BotScoreNotModified` if the new score is not greater than the user's current score in the chat and force is False.
|
||||||
"""
|
"""
|
||||||
r = self.send(
|
r = self.send(
|
||||||
|
@@ -43,7 +43,7 @@ class DeleteChatPhoto(BaseClient):
|
|||||||
True on success.
|
True on success.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
``ValueError`` if a chat_id belongs to user.
|
``ValueError`` if a chat_id belongs to user.
|
||||||
"""
|
"""
|
||||||
peer = self.resolve_peer(chat_id)
|
peer = self.resolve_peer(chat_id)
|
||||||
|
@@ -40,7 +40,7 @@ class ExportChatInviteLink(BaseClient):
|
|||||||
On success, the exported invite link as string is returned.
|
On success, the exported invite link as string is returned.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
peer = self.resolve_peer(chat_id)
|
peer = self.resolve_peer(chat_id)
|
||||||
|
|
||||||
|
@@ -42,7 +42,7 @@ class GetChat(BaseClient):
|
|||||||
On success, a :obj:`Chat <pyrogram.Chat>` object is returned.
|
On success, a :obj:`Chat <pyrogram.Chat>` object is returned.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
``ValueError`` in case the chat invite link refers to a chat you haven't joined yet.
|
``ValueError`` in case the chat invite link refers to a chat you haven't joined yet.
|
||||||
"""
|
"""
|
||||||
match = self.INVITE_LINK_RE.match(str(chat_id))
|
match = self.INVITE_LINK_RE.match(str(chat_id))
|
||||||
|
@@ -19,7 +19,8 @@
|
|||||||
from typing import Union
|
from typing import Union
|
||||||
|
|
||||||
import pyrogram
|
import pyrogram
|
||||||
from pyrogram.api import functions, types, errors
|
from pyrogram.api import functions, types
|
||||||
|
from pyrogram.errors import UserNotParticipant
|
||||||
from ...ext import BaseClient
|
from ...ext import BaseClient
|
||||||
|
|
||||||
|
|
||||||
@@ -44,7 +45,7 @@ class GetChatMember(BaseClient):
|
|||||||
On success, a :obj:`ChatMember <pyrogram.ChatMember>` object is returned.
|
On success, a :obj:`ChatMember <pyrogram.ChatMember>` object is returned.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
chat_id = self.resolve_peer(chat_id)
|
chat_id = self.resolve_peer(chat_id)
|
||||||
user_id = self.resolve_peer(user_id)
|
user_id = self.resolve_peer(user_id)
|
||||||
@@ -60,7 +61,7 @@ class GetChatMember(BaseClient):
|
|||||||
if member.user.is_self:
|
if member.user.is_self:
|
||||||
return member
|
return member
|
||||||
else:
|
else:
|
||||||
raise errors.UserNotParticipant
|
raise UserNotParticipant
|
||||||
elif isinstance(chat_id, types.InputPeerChannel):
|
elif isinstance(chat_id, types.InputPeerChannel):
|
||||||
r = self.send(
|
r = self.send(
|
||||||
functions.channels.GetParticipant(
|
functions.channels.GetParticipant(
|
||||||
|
@@ -84,7 +84,7 @@ class GetChatMembers(BaseClient):
|
|||||||
On success, a :obj:`ChatMembers` object is returned.
|
On success, a :obj:`ChatMembers` object is returned.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
``ValueError`` if you used an invalid filter or a chat_id that belongs to a user.
|
``ValueError`` if you used an invalid filter or a chat_id that belongs to a user.
|
||||||
"""
|
"""
|
||||||
peer = self.resolve_peer(chat_id)
|
peer = self.resolve_peer(chat_id)
|
||||||
|
@@ -37,7 +37,7 @@ class GetChatMembersCount(BaseClient):
|
|||||||
On success, an integer is returned.
|
On success, an integer is returned.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
``ValueError`` if a chat_id belongs to user.
|
``ValueError`` if a chat_id belongs to user.
|
||||||
"""
|
"""
|
||||||
peer = self.resolve_peer(chat_id)
|
peer = self.resolve_peer(chat_id)
|
||||||
|
@@ -38,7 +38,7 @@ class GetChatPreview(BaseClient):
|
|||||||
Either :obj:`Chat` or :obj:`ChatPreview`, depending on whether you already joined the chat or not.
|
Either :obj:`Chat` or :obj:`ChatPreview`, depending on whether you already joined the chat or not.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
``ValueError`` in case of an invalid invite_link.
|
``ValueError`` in case of an invalid invite_link.
|
||||||
"""
|
"""
|
||||||
match = self.INVITE_LINK_RE.match(invite_link)
|
match = self.INVITE_LINK_RE.match(invite_link)
|
||||||
|
@@ -21,7 +21,7 @@ import time
|
|||||||
|
|
||||||
import pyrogram
|
import pyrogram
|
||||||
from pyrogram.api import functions, types
|
from pyrogram.api import functions, types
|
||||||
from pyrogram.api.errors import FloodWait
|
from pyrogram.errors import FloodWait
|
||||||
from ...ext import BaseClient
|
from ...ext import BaseClient
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
@@ -56,7 +56,7 @@ class GetDialogs(BaseClient):
|
|||||||
On success, a :obj:`Dialogs` object is returned.
|
On success, a :obj:`Dialogs` object is returned.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
|
@@ -78,7 +78,7 @@ class IterChatMembers(BaseClient):
|
|||||||
A generator yielding :obj:`ChatMember <pyrogram.ChatMember>` objects.
|
A generator yielding :obj:`ChatMember <pyrogram.ChatMember>` objects.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
current = 0
|
current = 0
|
||||||
yielded = set()
|
yielded = set()
|
||||||
|
@@ -46,7 +46,7 @@ class IterDialogs(BaseClient):
|
|||||||
A generator yielding :obj:`Dialog <pyrogram.Dialog>` objects.
|
A generator yielding :obj:`Dialog <pyrogram.Dialog>` objects.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
current = 0
|
current = 0
|
||||||
total = limit or (1 << 31) - 1
|
total = limit or (1 << 31) - 1
|
||||||
|
@@ -37,7 +37,7 @@ class JoinChat(BaseClient):
|
|||||||
On success, a :obj:`Chat <pyrogram.Chat>` object is returned.
|
On success, a :obj:`Chat <pyrogram.Chat>` object is returned.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
match = self.INVITE_LINK_RE.match(chat_id)
|
match = self.INVITE_LINK_RE.match(chat_id)
|
||||||
|
|
||||||
|
@@ -57,7 +57,7 @@ class KickChatMember(BaseClient):
|
|||||||
On success, either True or a service :obj:`Message <pyrogram.Message>` will be returned (when applicable).
|
On success, either True or a service :obj:`Message <pyrogram.Message>` will be returned (when applicable).
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
chat_peer = self.resolve_peer(chat_id)
|
chat_peer = self.resolve_peer(chat_id)
|
||||||
user_peer = self.resolve_peer(user_id)
|
user_peer = self.resolve_peer(user_id)
|
||||||
|
@@ -39,7 +39,7 @@ class LeaveChat(BaseClient):
|
|||||||
Deletes the group chat dialog after leaving (for simple group chats, not supergroups).
|
Deletes the group chat dialog after leaving (for simple group chats, not supergroups).
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
peer = self.resolve_peer(chat_id)
|
peer = self.resolve_peer(chat_id)
|
||||||
|
|
||||||
|
@@ -48,7 +48,7 @@ class PinChatMessage(BaseClient):
|
|||||||
True on success.
|
True on success.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
self.send(
|
self.send(
|
||||||
functions.messages.UpdatePinnedMessage(
|
functions.messages.UpdatePinnedMessage(
|
||||||
|
@@ -79,7 +79,7 @@ class PromoteChatMember(BaseClient):
|
|||||||
True on success.
|
True on success.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
self.send(
|
self.send(
|
||||||
functions.channels.EditAdmin(
|
functions.channels.EditAdmin(
|
||||||
|
@@ -73,7 +73,7 @@ class RestrictChat(BaseClient):
|
|||||||
On success, a :obj:`Chat <pyrogram.Chat>` object is returned.
|
On success, a :obj:`Chat <pyrogram.Chat>` object is returned.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
send_messages = True
|
send_messages = True
|
||||||
send_media = True
|
send_media = True
|
||||||
|
@@ -86,7 +86,7 @@ class RestrictChatMember(BaseClient):
|
|||||||
On success, a :obj:`Chat <pyrogram.Chat>` object is returned.
|
On success, a :obj:`Chat <pyrogram.Chat>` object is returned.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
send_messages = True
|
send_messages = True
|
||||||
send_media = True
|
send_media = True
|
||||||
|
@@ -42,7 +42,7 @@ class SetChatDescription(BaseClient):
|
|||||||
True on success.
|
True on success.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
``ValueError`` if a chat_id doesn't belong to a supergroup or a channel.
|
``ValueError`` if a chat_id doesn't belong to a supergroup or a channel.
|
||||||
"""
|
"""
|
||||||
peer = self.resolve_peer(chat_id)
|
peer = self.resolve_peer(chat_id)
|
||||||
|
@@ -50,7 +50,7 @@ class SetChatPhoto(BaseClient):
|
|||||||
True on success.
|
True on success.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
``ValueError`` if a chat_id belongs to user.
|
``ValueError`` if a chat_id belongs to user.
|
||||||
"""
|
"""
|
||||||
peer = self.resolve_peer(chat_id)
|
peer = self.resolve_peer(chat_id)
|
||||||
|
@@ -47,7 +47,7 @@ class SetChatTitle(BaseClient):
|
|||||||
True on success.
|
True on success.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
``ValueError`` if a chat_id belongs to user.
|
``ValueError`` if a chat_id belongs to user.
|
||||||
"""
|
"""
|
||||||
peer = self.resolve_peer(chat_id)
|
peer = self.resolve_peer(chat_id)
|
||||||
|
@@ -44,7 +44,7 @@ class UnbanChatMember(BaseClient):
|
|||||||
True on success.
|
True on success.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
self.send(
|
self.send(
|
||||||
functions.channels.EditBanned(
|
functions.channels.EditBanned(
|
||||||
|
@@ -39,7 +39,7 @@ class UnpinChatMessage(BaseClient):
|
|||||||
True on success.
|
True on success.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
self.send(
|
self.send(
|
||||||
functions.messages.UpdatePinnedMessage(
|
functions.messages.UpdatePinnedMessage(
|
||||||
|
@@ -42,7 +42,7 @@ class UpdateChatUsername(BaseClient):
|
|||||||
True on success.
|
True on success.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
``ValueError`` if a chat_id belongs to a user or chat.
|
``ValueError`` if a chat_id belongs to a user or chat.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@@ -38,7 +38,7 @@ class AddContacts(BaseClient):
|
|||||||
On success, the added contacts are returned.
|
On success, the added contacts are returned.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
imported_contacts = self.send(
|
imported_contacts = self.send(
|
||||||
functions.contacts.ImportContacts(
|
functions.contacts.ImportContacts(
|
||||||
|
@@ -19,7 +19,7 @@
|
|||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
from pyrogram.api import functions, types
|
from pyrogram.api import functions, types
|
||||||
from pyrogram.api.errors import PeerIdInvalid
|
from pyrogram.errors import PeerIdInvalid
|
||||||
from ...ext import BaseClient
|
from ...ext import BaseClient
|
||||||
|
|
||||||
|
|
||||||
@@ -39,7 +39,7 @@ class DeleteContacts(BaseClient):
|
|||||||
True on success.
|
True on success.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
contacts = []
|
contacts = []
|
||||||
|
|
||||||
|
@@ -21,7 +21,7 @@ import time
|
|||||||
|
|
||||||
import pyrogram
|
import pyrogram
|
||||||
from pyrogram.api import functions
|
from pyrogram.api import functions
|
||||||
from pyrogram.api.errors import FloodWait
|
from pyrogram.errors import FloodWait
|
||||||
from ...ext import BaseClient
|
from ...ext import BaseClient
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
@@ -35,7 +35,7 @@ class GetContacts(BaseClient):
|
|||||||
On success, a list of :obj:`User` objects is returned.
|
On success, a list of :obj:`User` objects is returned.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
|
@@ -45,7 +45,7 @@ class ClosePoll(BaseClient):
|
|||||||
On success, True is returned.
|
On success, True is returned.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
poll = self.get_messages(chat_id, message_id).poll
|
poll = self.get_messages(chat_id, message_id).poll
|
||||||
|
|
||||||
|
@@ -59,7 +59,7 @@ class DeleteMessages(BaseClient):
|
|||||||
True on success.
|
True on success.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
peer = self.resolve_peer(chat_id)
|
peer = self.resolve_peer(chat_id)
|
||||||
message_ids = list(message_ids) if not isinstance(message_ids, int) else [message_ids]
|
message_ids = list(message_ids) if not isinstance(message_ids, int) else [message_ids]
|
||||||
|
@@ -77,7 +77,7 @@ class DownloadMedia(BaseClient):
|
|||||||
In case the download is deliberately stopped with :meth:`stop_transmission`, None is returned as well.
|
In case the download is deliberately stopped with :meth:`stop_transmission`, None is returned as well.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
``ValueError`` if the message doesn't contain any downloadable media
|
``ValueError`` if the message doesn't contain any downloadable media
|
||||||
"""
|
"""
|
||||||
error_message = "This message doesn't contain any downloadable media"
|
error_message = "This message doesn't contain any downloadable media"
|
||||||
|
@@ -58,7 +58,7 @@ class EditMessageCaption(BaseClient):
|
|||||||
On success, the edited :obj:`Message <pyrogram.Message>` is returned.
|
On success, the edited :obj:`Message <pyrogram.Message>` is returned.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
style = self.html if parse_mode.lower() == "html" else self.markdown
|
style = self.html if parse_mode.lower() == "html" else self.markdown
|
||||||
|
|
||||||
|
@@ -23,7 +23,7 @@ from typing import Union
|
|||||||
|
|
||||||
import pyrogram
|
import pyrogram
|
||||||
from pyrogram.api import functions, types
|
from pyrogram.api import functions, types
|
||||||
from pyrogram.api.errors import FileIdInvalid
|
from pyrogram.errors import FileIdInvalid
|
||||||
from pyrogram.client.ext import BaseClient, utils
|
from pyrogram.client.ext import BaseClient, utils
|
||||||
from pyrogram.client.types import (
|
from pyrogram.client.types import (
|
||||||
InputMediaPhoto, InputMediaVideo, InputMediaAudio,
|
InputMediaPhoto, InputMediaVideo, InputMediaAudio,
|
||||||
@@ -66,7 +66,7 @@ class EditMessageMedia(BaseClient):
|
|||||||
On success, the edited :obj:`Message <pyrogram.Message>` is returned.
|
On success, the edited :obj:`Message <pyrogram.Message>` is returned.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
style = self.html if media.parse_mode.lower() == "html" else self.markdown
|
style = self.html if media.parse_mode.lower() == "html" else self.markdown
|
||||||
caption = media.caption
|
caption = media.caption
|
||||||
|
@@ -49,7 +49,7 @@ class EditMessageReplyMarkup(BaseClient):
|
|||||||
:obj:`Message <pyrogram.Message>` is returned, otherwise True is returned.
|
:obj:`Message <pyrogram.Message>` is returned, otherwise True is returned.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
r = self.send(
|
r = self.send(
|
||||||
|
@@ -62,7 +62,7 @@ class EditMessageText(BaseClient):
|
|||||||
On success, the edited :obj:`Message <pyrogram.Message>` is returned.
|
On success, the edited :obj:`Message <pyrogram.Message>` is returned.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
style = self.html if parse_mode.lower() == "html" else self.markdown
|
style = self.html if parse_mode.lower() == "html" else self.markdown
|
||||||
|
|
||||||
|
@@ -70,7 +70,7 @@ class ForwardMessages(BaseClient):
|
|||||||
is returned.
|
is returned.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
is_iterable = not isinstance(message_ids, int)
|
is_iterable = not isinstance(message_ids, int)
|
||||||
|
@@ -22,7 +22,7 @@ from typing import Union
|
|||||||
|
|
||||||
import pyrogram
|
import pyrogram
|
||||||
from pyrogram.api import functions
|
from pyrogram.api import functions
|
||||||
from pyrogram.api.errors import FloodWait
|
from pyrogram.errors import FloodWait
|
||||||
from ...ext import BaseClient
|
from ...ext import BaseClient
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
@@ -70,7 +70,7 @@ class GetHistory(BaseClient):
|
|||||||
On success, a :obj:`Messages <pyrogram.Messages>` object is returned.
|
On success, a :obj:`Messages <pyrogram.Messages>` object is returned.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
|
@@ -22,7 +22,7 @@ from typing import Union, Iterable
|
|||||||
|
|
||||||
import pyrogram
|
import pyrogram
|
||||||
from pyrogram.api import functions, types
|
from pyrogram.api import functions, types
|
||||||
from pyrogram.api.errors import FloodWait
|
from pyrogram.errors import FloodWait
|
||||||
from ...ext import BaseClient
|
from ...ext import BaseClient
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
@@ -63,7 +63,7 @@ class GetMessages(BaseClient):
|
|||||||
*reply_to_message_ids* was an integer, the single requested :obj:`Message <pyrogram.Message>` is returned.
|
*reply_to_message_ids* was an integer, the single requested :obj:`Message <pyrogram.Message>` is returned.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
ids, ids_type = (
|
ids, ids_type = (
|
||||||
(message_ids, types.InputMessageID) if message_ids
|
(message_ids, types.InputMessageID) if message_ids
|
||||||
|
@@ -64,7 +64,7 @@ class IterHistory(BaseClient):
|
|||||||
A generator yielding :obj:`Message <pyrogram.Message>` objects.
|
A generator yielding :obj:`Message <pyrogram.Message>` objects.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
offset_id = offset_id or (1 if reverse else 0)
|
offset_id = offset_id or (1 if reverse else 0)
|
||||||
current = 0
|
current = 0
|
||||||
|
@@ -43,7 +43,7 @@ class RetractVote(BaseClient):
|
|||||||
On success, True is returned.
|
On success, True is returned.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
self.send(
|
self.send(
|
||||||
functions.messages.SendVote(
|
functions.messages.SendVote(
|
||||||
|
@@ -23,7 +23,7 @@ from typing import Union
|
|||||||
|
|
||||||
import pyrogram
|
import pyrogram
|
||||||
from pyrogram.api import functions, types
|
from pyrogram.api import functions, types
|
||||||
from pyrogram.api.errors import FileIdInvalid, FilePartMissing
|
from pyrogram.errors import FileIdInvalid, FilePartMissing
|
||||||
from pyrogram.client.ext import BaseClient, utils
|
from pyrogram.client.ext import BaseClient, utils
|
||||||
|
|
||||||
|
|
||||||
@@ -125,7 +125,7 @@ class SendAnimation(BaseClient):
|
|||||||
In case the upload is deliberately stopped with :meth:`stop_transmission`, None is returned instead.
|
In case the upload is deliberately stopped with :meth:`stop_transmission`, None is returned instead.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
file = None
|
file = None
|
||||||
style = self.html if parse_mode.lower() == "html" else self.markdown
|
style = self.html if parse_mode.lower() == "html" else self.markdown
|
||||||
|
@@ -23,7 +23,7 @@ from typing import Union
|
|||||||
|
|
||||||
import pyrogram
|
import pyrogram
|
||||||
from pyrogram.api import functions, types
|
from pyrogram.api import functions, types
|
||||||
from pyrogram.api.errors import FileIdInvalid, FilePartMissing
|
from pyrogram.errors import FileIdInvalid, FilePartMissing
|
||||||
from pyrogram.client.ext import BaseClient, utils
|
from pyrogram.client.ext import BaseClient, utils
|
||||||
|
|
||||||
|
|
||||||
@@ -127,7 +127,7 @@ class SendAudio(BaseClient):
|
|||||||
In case the upload is deliberately stopped with :meth:`stop_transmission`, None is returned instead.
|
In case the upload is deliberately stopped with :meth:`stop_transmission`, None is returned instead.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
file = None
|
file = None
|
||||||
style = self.html if parse_mode.lower() == "html" else self.markdown
|
style = self.html if parse_mode.lower() == "html" else self.markdown
|
||||||
|
@@ -22,7 +22,7 @@ from typing import Union
|
|||||||
|
|
||||||
import pyrogram
|
import pyrogram
|
||||||
from pyrogram.api import functions, types
|
from pyrogram.api import functions, types
|
||||||
from pyrogram.api.errors import FileIdInvalid
|
from pyrogram.errors import FileIdInvalid
|
||||||
from pyrogram.client.ext import BaseClient, utils
|
from pyrogram.client.ext import BaseClient, utils
|
||||||
|
|
||||||
|
|
||||||
@@ -81,7 +81,7 @@ class SendCachedMedia(BaseClient):
|
|||||||
On success, the sent :obj:`Message <pyrogram.Message>` is returned.
|
On success, the sent :obj:`Message <pyrogram.Message>` is returned.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
style = self.html if parse_mode.lower() == "html" else self.markdown
|
style = self.html if parse_mode.lower() == "html" else self.markdown
|
||||||
|
|
||||||
|
@@ -51,7 +51,7 @@ class SendChatAction(BaseClient):
|
|||||||
On success, True is returned.
|
On success, True is returned.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
``ValueError`` if the provided string is not a valid ChatAction.
|
``ValueError`` if the provided string is not a valid ChatAction.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@@ -75,7 +75,7 @@ class SendContact(BaseClient):
|
|||||||
On success, the sent :obj:`Message <pyrogram.Message>` is returned.
|
On success, the sent :obj:`Message <pyrogram.Message>` is returned.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
r = self.send(
|
r = self.send(
|
||||||
functions.messages.SendMedia(
|
functions.messages.SendMedia(
|
||||||
|
@@ -23,7 +23,7 @@ from typing import Union
|
|||||||
|
|
||||||
import pyrogram
|
import pyrogram
|
||||||
from pyrogram.api import functions, types
|
from pyrogram.api import functions, types
|
||||||
from pyrogram.api.errors import FileIdInvalid, FilePartMissing
|
from pyrogram.errors import FileIdInvalid, FilePartMissing
|
||||||
from pyrogram.client.ext import BaseClient, utils
|
from pyrogram.client.ext import BaseClient, utils
|
||||||
|
|
||||||
|
|
||||||
@@ -113,7 +113,7 @@ class SendDocument(BaseClient):
|
|||||||
In case the upload is deliberately stopped with :meth:`stop_transmission`, None is returned instead.
|
In case the upload is deliberately stopped with :meth:`stop_transmission`, None is returned instead.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
file = None
|
file = None
|
||||||
style = self.html if parse_mode.lower() == "html" else self.markdown
|
style = self.html if parse_mode.lower() == "html" else self.markdown
|
||||||
|
@@ -67,7 +67,7 @@ class SendLocation(BaseClient):
|
|||||||
On success, the sent :obj:`Message <pyrogram.Message>` is returned.
|
On success, the sent :obj:`Message <pyrogram.Message>` is returned.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
r = self.send(
|
r = self.send(
|
||||||
functions.messages.SendMedia(
|
functions.messages.SendMedia(
|
||||||
|
@@ -25,7 +25,7 @@ from typing import Union, List
|
|||||||
|
|
||||||
import pyrogram
|
import pyrogram
|
||||||
from pyrogram.api import functions, types
|
from pyrogram.api import functions, types
|
||||||
from pyrogram.api.errors import FileIdInvalid, FloodWait
|
from pyrogram.errors import FileIdInvalid, FloodWait
|
||||||
from pyrogram.client.ext import BaseClient, utils
|
from pyrogram.client.ext import BaseClient, utils
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
@@ -64,7 +64,7 @@ class SendMediaGroup(BaseClient):
|
|||||||
single messages sent.
|
single messages sent.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
multi_media = []
|
multi_media = []
|
||||||
|
|
||||||
|
@@ -73,7 +73,7 @@ class SendMessage(BaseClient):
|
|||||||
On success, the sent :obj:`Message` is returned.
|
On success, the sent :obj:`Message` is returned.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
style = self.html if parse_mode.lower() == "html" else self.markdown
|
style = self.html if parse_mode.lower() == "html" else self.markdown
|
||||||
message, entities = style.parse(text).values()
|
message, entities = style.parse(text).values()
|
||||||
|
@@ -23,7 +23,7 @@ from typing import Union
|
|||||||
|
|
||||||
import pyrogram
|
import pyrogram
|
||||||
from pyrogram.api import functions, types
|
from pyrogram.api import functions, types
|
||||||
from pyrogram.api.errors import FileIdInvalid, FilePartMissing
|
from pyrogram.errors import FileIdInvalid, FilePartMissing
|
||||||
from pyrogram.client.ext import BaseClient, utils
|
from pyrogram.client.ext import BaseClient, utils
|
||||||
|
|
||||||
|
|
||||||
@@ -112,7 +112,7 @@ class SendPhoto(BaseClient):
|
|||||||
In case the upload is deliberately stopped with :meth:`stop_transmission`, None is returned instead.
|
In case the upload is deliberately stopped with :meth:`stop_transmission`, None is returned instead.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
file = None
|
file = None
|
||||||
style = self.html if parse_mode.lower() == "html" else self.markdown
|
style = self.html if parse_mode.lower() == "html" else self.markdown
|
||||||
|
@@ -67,7 +67,7 @@ class SendPoll(BaseClient):
|
|||||||
On success, the sent :obj:`Message <pyrogram.Message>` is returned.
|
On success, the sent :obj:`Message <pyrogram.Message>` is returned.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
r = self.send(
|
r = self.send(
|
||||||
functions.messages.SendMedia(
|
functions.messages.SendMedia(
|
||||||
|
@@ -23,7 +23,7 @@ from typing import Union
|
|||||||
|
|
||||||
import pyrogram
|
import pyrogram
|
||||||
from pyrogram.api import functions, types
|
from pyrogram.api import functions, types
|
||||||
from pyrogram.api.errors import FileIdInvalid, FilePartMissing
|
from pyrogram.errors import FileIdInvalid, FilePartMissing
|
||||||
from pyrogram.client.ext import BaseClient, utils
|
from pyrogram.client.ext import BaseClient, utils
|
||||||
|
|
||||||
|
|
||||||
@@ -96,7 +96,7 @@ class SendSticker(BaseClient):
|
|||||||
In case the upload is deliberately stopped with :meth:`stop_transmission`, None is returned instead.
|
In case the upload is deliberately stopped with :meth:`stop_transmission`, None is returned instead.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
file = None
|
file = None
|
||||||
|
|
||||||
|
@@ -84,7 +84,7 @@ class SendVenue(BaseClient):
|
|||||||
On success, the sent :obj:`Message <pyrogram.Message>` is returned.
|
On success, the sent :obj:`Message <pyrogram.Message>` is returned.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
r = self.send(
|
r = self.send(
|
||||||
functions.messages.SendMedia(
|
functions.messages.SendMedia(
|
||||||
|
@@ -23,7 +23,7 @@ from typing import Union
|
|||||||
|
|
||||||
import pyrogram
|
import pyrogram
|
||||||
from pyrogram.api import functions, types
|
from pyrogram.api import functions, types
|
||||||
from pyrogram.api.errors import FileIdInvalid, FilePartMissing
|
from pyrogram.errors import FileIdInvalid, FilePartMissing
|
||||||
from pyrogram.client.ext import BaseClient, utils
|
from pyrogram.client.ext import BaseClient, utils
|
||||||
|
|
||||||
|
|
||||||
@@ -129,7 +129,7 @@ class SendVideo(BaseClient):
|
|||||||
In case the upload is deliberately stopped with :meth:`stop_transmission`, None is returned instead.
|
In case the upload is deliberately stopped with :meth:`stop_transmission`, None is returned instead.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
file = None
|
file = None
|
||||||
style = self.html if parse_mode.lower() == "html" else self.markdown
|
style = self.html if parse_mode.lower() == "html" else self.markdown
|
||||||
|
@@ -23,7 +23,7 @@ from typing import Union
|
|||||||
|
|
||||||
import pyrogram
|
import pyrogram
|
||||||
from pyrogram.api import functions, types
|
from pyrogram.api import functions, types
|
||||||
from pyrogram.api.errors import FileIdInvalid, FilePartMissing
|
from pyrogram.errors import FileIdInvalid, FilePartMissing
|
||||||
from pyrogram.client.ext import BaseClient, utils
|
from pyrogram.client.ext import BaseClient, utils
|
||||||
|
|
||||||
|
|
||||||
@@ -111,7 +111,7 @@ class SendVideoNote(BaseClient):
|
|||||||
In case the upload is deliberately stopped with :meth:`stop_transmission`, None is returned instead.
|
In case the upload is deliberately stopped with :meth:`stop_transmission`, None is returned instead.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
file = None
|
file = None
|
||||||
|
|
||||||
|
@@ -23,7 +23,7 @@ from typing import Union
|
|||||||
|
|
||||||
import pyrogram
|
import pyrogram
|
||||||
from pyrogram.api import functions, types
|
from pyrogram.api import functions, types
|
||||||
from pyrogram.api.errors import FileIdInvalid, FilePartMissing
|
from pyrogram.errors import FileIdInvalid, FilePartMissing
|
||||||
from pyrogram.client.ext import BaseClient, utils
|
from pyrogram.client.ext import BaseClient, utils
|
||||||
|
|
||||||
|
|
||||||
@@ -110,7 +110,7 @@ class SendVoice(BaseClient):
|
|||||||
In case the upload is deliberately stopped with :meth:`stop_transmission`, None is returned instead.
|
In case the upload is deliberately stopped with :meth:`stop_transmission`, None is returned instead.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
file = None
|
file = None
|
||||||
style = self.html if parse_mode.lower() == "html" else self.markdown
|
style = self.html if parse_mode.lower() == "html" else self.markdown
|
||||||
|
@@ -47,7 +47,7 @@ class VotePoll(BaseClient):
|
|||||||
On success, True is returned.
|
On success, True is returned.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
poll = self.get_messages(chat_id, message_id).poll
|
poll = self.get_messages(chat_id, message_id).poll
|
||||||
|
|
||||||
|
@@ -46,7 +46,7 @@ class ChangeCloudPassword(BaseClient):
|
|||||||
True on success.
|
True on success.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
``ValueError`` in case there is no cloud password to change.
|
``ValueError`` in case there is no cloud password to change.
|
||||||
"""
|
"""
|
||||||
r = self.send(functions.account.GetPassword())
|
r = self.send(functions.account.GetPassword())
|
||||||
|
@@ -48,7 +48,7 @@ class EnableCloudPassword(BaseClient):
|
|||||||
True on success.
|
True on success.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
``ValueError`` in case there is already a cloud password enabled.
|
``ValueError`` in case there is already a cloud password enabled.
|
||||||
"""
|
"""
|
||||||
r = self.send(functions.account.GetPassword())
|
r = self.send(functions.account.GetPassword())
|
||||||
|
@@ -36,7 +36,7 @@ class RemoveCloudPassword(BaseClient):
|
|||||||
True on success.
|
True on success.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
``ValueError`` in case there is no cloud password to remove.
|
``ValueError`` in case there is no cloud password to remove.
|
||||||
"""
|
"""
|
||||||
r = self.send(functions.account.GetPassword())
|
r = self.send(functions.account.GetPassword())
|
||||||
|
@@ -40,7 +40,7 @@ class DeleteUserProfilePhotos(BaseClient):
|
|||||||
True on success.
|
True on success.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
id = id if isinstance(id, list) else [id]
|
id = id if isinstance(id, list) else [id]
|
||||||
input_photos = []
|
input_photos = []
|
||||||
|
@@ -29,7 +29,7 @@ class GetMe(BaseClient):
|
|||||||
Basic information about the user or bot in form of a :obj:`User` object
|
Basic information about the user or bot in form of a :obj:`User` object
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
return pyrogram.User._parse(
|
return pyrogram.User._parse(
|
||||||
self,
|
self,
|
||||||
|
@@ -50,7 +50,7 @@ class GetUserProfilePhotos(BaseClient):
|
|||||||
On success, a :obj:`UserProfilePhotos` object is returned.
|
On success, a :obj:`UserProfilePhotos` object is returned.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
return pyrogram.UserProfilePhotos._parse(
|
return pyrogram.UserProfilePhotos._parse(
|
||||||
self,
|
self,
|
||||||
|
@@ -43,7 +43,7 @@ class GetUsers(BaseClient):
|
|||||||
*user_ids* was an integer or string, the single requested :obj:`User` is returned.
|
*user_ids* was an integer or string, the single requested :obj:`User` is returned.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
is_iterable = not isinstance(user_ids, (int, str))
|
is_iterable = not isinstance(user_ids, (int, str))
|
||||||
user_ids = list(user_ids) if is_iterable else [user_ids]
|
user_ids = list(user_ids) if is_iterable else [user_ids]
|
||||||
|
@@ -39,7 +39,7 @@ class SetUserProfilePhoto(BaseClient):
|
|||||||
True on success.
|
True on success.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return bool(
|
return bool(
|
||||||
|
@@ -41,7 +41,7 @@ class UpdateUsername(BaseClient):
|
|||||||
True on success.
|
True on success.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return bool(
|
return bool(
|
||||||
|
@@ -16,28 +16,10 @@
|
|||||||
# 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 .bots import (
|
from .bots import *
|
||||||
ForceReply, InlineKeyboardButton, InlineKeyboardMarkup,
|
from .inline_mode import *
|
||||||
KeyboardButton, ReplyKeyboardMarkup, ReplyKeyboardRemove, CallbackGame,
|
from .input_media import *
|
||||||
GameHighScore, GameHighScores, CallbackQuery
|
from .input_message_content import *
|
||||||
)
|
from .messages_and_media import *
|
||||||
from .inline_mode import (
|
from .update import *
|
||||||
InlineQuery, InlineQueryResult, InlineQueryResultArticle
|
from .user_and_chats import *
|
||||||
)
|
|
||||||
from .input_media import (
|
|
||||||
InputMedia, InputMediaAudio, InputPhoneContact, InputMediaVideo, InputMediaPhoto,
|
|
||||||
InputMediaDocument, InputMediaAnimation
|
|
||||||
)
|
|
||||||
from .input_message_content import (
|
|
||||||
InputMessageContent, InputTextMessageContent
|
|
||||||
)
|
|
||||||
from .messages_and_media import (
|
|
||||||
Audio, Contact, Document, Animation, Location, Photo, PhotoSize,
|
|
||||||
Sticker, Venue, Video, VideoNote, Voice, UserProfilePhotos,
|
|
||||||
Message, Messages, MessageEntity, Poll, PollOption, Game
|
|
||||||
)
|
|
||||||
from .update import StopPropagation, ContinuePropagation
|
|
||||||
from .user_and_chats import (
|
|
||||||
Chat, ChatMember, ChatMembers, ChatPhoto,
|
|
||||||
Dialog, Dialogs, User, UserStatus, ChatPreview, ChatPermissions
|
|
||||||
)
|
|
||||||
|
@@ -26,3 +26,8 @@ from .inline_keyboard_markup import InlineKeyboardMarkup
|
|||||||
from .keyboard_button import KeyboardButton
|
from .keyboard_button import KeyboardButton
|
||||||
from .reply_keyboard_markup import ReplyKeyboardMarkup
|
from .reply_keyboard_markup import ReplyKeyboardMarkup
|
||||||
from .reply_keyboard_remove import ReplyKeyboardRemove
|
from .reply_keyboard_remove import ReplyKeyboardRemove
|
||||||
|
|
||||||
|
__all__ = [
|
||||||
|
"CallbackGame", "CallbackQuery", "ForceReply", "GameHighScore", "GameHighScores", "InlineKeyboardButton",
|
||||||
|
"InlineKeyboardMarkup", "KeyboardButton", "ReplyKeyboardMarkup", "ReplyKeyboardRemove"
|
||||||
|
]
|
||||||
|
@@ -19,3 +19,7 @@
|
|||||||
from .inline_query import InlineQuery
|
from .inline_query import InlineQuery
|
||||||
from .inline_query_result import InlineQueryResult
|
from .inline_query_result import InlineQueryResult
|
||||||
from .inline_query_result_article import InlineQueryResultArticle
|
from .inline_query_result_article import InlineQueryResultArticle
|
||||||
|
|
||||||
|
__all__ = [
|
||||||
|
"InlineQuery", "InlineQueryResult", "InlineQueryResultArticle"
|
||||||
|
]
|
||||||
|
@@ -20,7 +20,7 @@ import binascii
|
|||||||
import struct
|
import struct
|
||||||
|
|
||||||
from pyrogram.api import types
|
from pyrogram.api import types
|
||||||
from pyrogram.api.errors import FileIdInvalid
|
from pyrogram.errors import FileIdInvalid
|
||||||
from pyrogram.client.ext import utils, BaseClient
|
from pyrogram.client.ext import utils, BaseClient
|
||||||
from pyrogram.client.style import HTML, Markdown
|
from pyrogram.client.style import HTML, Markdown
|
||||||
from pyrogram.client.types.pyrogram_type import PyrogramType
|
from pyrogram.client.types.pyrogram_type import PyrogramType
|
||||||
|
@@ -23,3 +23,8 @@ from .input_media_document import InputMediaDocument
|
|||||||
from .input_media_photo import InputMediaPhoto
|
from .input_media_photo import InputMediaPhoto
|
||||||
from .input_media_video import InputMediaVideo
|
from .input_media_video import InputMediaVideo
|
||||||
from .input_phone_contact import InputPhoneContact
|
from .input_phone_contact import InputPhoneContact
|
||||||
|
|
||||||
|
__all__ = [
|
||||||
|
"InputMedia", "InputMediaAnimation", "InputMediaAudio", "InputMediaDocument", "InputMediaPhoto", "InputMediaVideo",
|
||||||
|
"InputPhoneContact"
|
||||||
|
]
|
||||||
|
@@ -18,3 +18,7 @@
|
|||||||
|
|
||||||
from .input_message_content import InputMessageContent
|
from .input_message_content import InputMessageContent
|
||||||
from .input_text_message_content import InputTextMessageContent
|
from .input_text_message_content import InputTextMessageContent
|
||||||
|
|
||||||
|
__all__ = [
|
||||||
|
"InputMessageContent", "InputTextMessageContent"
|
||||||
|
]
|
||||||
|
@@ -35,3 +35,8 @@ from .venue import Venue
|
|||||||
from .video import Video
|
from .video import Video
|
||||||
from .video_note import VideoNote
|
from .video_note import VideoNote
|
||||||
from .voice import Voice
|
from .voice import Voice
|
||||||
|
|
||||||
|
__all__ = [
|
||||||
|
"Animation", "Audio", "Contact", "Document", "Game", "Location", "Message", "MessageEntity", "Messages", "Photo",
|
||||||
|
"PhotoSize", "Poll", "PollOption", "Sticker", "UserProfilePhotos", "Venue", "Video", "VideoNote", "Voice"
|
||||||
|
]
|
||||||
|
@@ -21,7 +21,7 @@ from typing import List, Match, Union
|
|||||||
|
|
||||||
import pyrogram
|
import pyrogram
|
||||||
from pyrogram.api import types
|
from pyrogram.api import types
|
||||||
from pyrogram.api.errors import MessageIdsEmpty
|
from pyrogram.errors import MessageIdsEmpty
|
||||||
from pyrogram.client.ext import ChatAction, ParseMode
|
from pyrogram.client.ext import ChatAction, ParseMode
|
||||||
from pyrogram.client.types.input_media import InputMedia
|
from pyrogram.client.types.input_media import InputMedia
|
||||||
from .contact import Contact
|
from .contact import Contact
|
||||||
@@ -708,7 +708,7 @@ class Message(PyrogramType, Update):
|
|||||||
On success, the sent Message is returned.
|
On success, the sent Message is returned.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>`
|
:class:`RPCError <pyrogram.RPCError>`
|
||||||
"""
|
"""
|
||||||
if quote is None:
|
if quote is None:
|
||||||
quote = self.chat.type != "private"
|
quote = self.chat.type != "private"
|
||||||
@@ -837,7 +837,7 @@ class Message(PyrogramType, Update):
|
|||||||
In case the upload is deliberately stopped with :meth:`stop_transmission`, None is returned instead.
|
In case the upload is deliberately stopped with :meth:`stop_transmission`, None is returned instead.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>`
|
:class:`RPCError <pyrogram.RPCError>`
|
||||||
"""
|
"""
|
||||||
if quote is None:
|
if quote is None:
|
||||||
quote = self.chat.type != "private"
|
quote = self.chat.type != "private"
|
||||||
@@ -972,7 +972,7 @@ class Message(PyrogramType, Update):
|
|||||||
In case the upload is deliberately stopped with :meth:`stop_transmission`, None is returned instead.
|
In case the upload is deliberately stopped with :meth:`stop_transmission`, None is returned instead.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>`
|
:class:`RPCError <pyrogram.RPCError>`
|
||||||
"""
|
"""
|
||||||
if quote is None:
|
if quote is None:
|
||||||
quote = self.chat.type != "private"
|
quote = self.chat.type != "private"
|
||||||
@@ -1060,7 +1060,7 @@ class Message(PyrogramType, Update):
|
|||||||
On success, the sent :obj:`Message <pyrogram.Message>` is returned.
|
On success, the sent :obj:`Message <pyrogram.Message>` is returned.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>`
|
:class:`RPCError <pyrogram.RPCError>`
|
||||||
"""
|
"""
|
||||||
if quote is None:
|
if quote is None:
|
||||||
quote = self.chat.type != "private"
|
quote = self.chat.type != "private"
|
||||||
@@ -1114,7 +1114,7 @@ class Message(PyrogramType, Update):
|
|||||||
On success, True is returned.
|
On success, True is returned.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
``ValueError`` if the provided string is not a valid ChatAction.
|
``ValueError`` if the provided string is not a valid ChatAction.
|
||||||
"""
|
"""
|
||||||
return self._client.send_chat_action(
|
return self._client.send_chat_action(
|
||||||
@@ -1189,7 +1189,7 @@ class Message(PyrogramType, Update):
|
|||||||
On success, the sent :obj:`Message <pyrogram.Message>` is returned.
|
On success, the sent :obj:`Message <pyrogram.Message>` is returned.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
if quote is None:
|
if quote is None:
|
||||||
quote = self.chat.type != "private"
|
quote = self.chat.type != "private"
|
||||||
@@ -1307,7 +1307,7 @@ class Message(PyrogramType, Update):
|
|||||||
In case the upload is deliberately stopped with :meth:`stop_transmission`, None is returned instead.
|
In case the upload is deliberately stopped with :meth:`stop_transmission`, None is returned instead.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
if quote is None:
|
if quote is None:
|
||||||
quote = self.chat.type != "private"
|
quote = self.chat.type != "private"
|
||||||
@@ -1381,7 +1381,7 @@ class Message(PyrogramType, Update):
|
|||||||
On success, the sent :obj:`Message` is returned.
|
On success, the sent :obj:`Message` is returned.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
if quote is None:
|
if quote is None:
|
||||||
quote = self.chat.type != "private"
|
quote = self.chat.type != "private"
|
||||||
@@ -1449,7 +1449,7 @@ class Message(PyrogramType, Update):
|
|||||||
On success, the sent Message is returned.
|
On success, the sent Message is returned.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
if quote is None:
|
if quote is None:
|
||||||
quote = self.chat.type != "private"
|
quote = self.chat.type != "private"
|
||||||
@@ -1524,7 +1524,7 @@ class Message(PyrogramType, Update):
|
|||||||
On success, the sent :obj:`Message <pyrogram.Message>` is returned.
|
On success, the sent :obj:`Message <pyrogram.Message>` is returned.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
if quote is None:
|
if quote is None:
|
||||||
quote = self.chat.type != "private"
|
quote = self.chat.type != "private"
|
||||||
@@ -1587,7 +1587,7 @@ class Message(PyrogramType, Update):
|
|||||||
single messages sent.
|
single messages sent.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
if quote is None:
|
if quote is None:
|
||||||
quote = self.chat.type != "private"
|
quote = self.chat.type != "private"
|
||||||
@@ -1700,7 +1700,7 @@ class Message(PyrogramType, Update):
|
|||||||
In case the upload is deliberately stopped with :meth:`stop_transmission`, None is returned instead.
|
In case the upload is deliberately stopped with :meth:`stop_transmission`, None is returned instead.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
if quote is None:
|
if quote is None:
|
||||||
quote = self.chat.type != "private"
|
quote = self.chat.type != "private"
|
||||||
@@ -1779,7 +1779,7 @@ class Message(PyrogramType, Update):
|
|||||||
On success, the sent :obj:`Message <pyrogram.Message>` is returned.
|
On success, the sent :obj:`Message <pyrogram.Message>` is returned.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
if quote is None:
|
if quote is None:
|
||||||
quote = self.chat.type != "private"
|
quote = self.chat.type != "private"
|
||||||
@@ -1878,7 +1878,7 @@ class Message(PyrogramType, Update):
|
|||||||
In case the upload is deliberately stopped with :meth:`stop_transmission`, None is returned instead.
|
In case the upload is deliberately stopped with :meth:`stop_transmission`, None is returned instead.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
if quote is None:
|
if quote is None:
|
||||||
quote = self.chat.type != "private"
|
quote = self.chat.type != "private"
|
||||||
@@ -1973,7 +1973,7 @@ class Message(PyrogramType, Update):
|
|||||||
On success, the sent :obj:`Message <pyrogram.Message>` is returned.
|
On success, the sent :obj:`Message <pyrogram.Message>` is returned.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
if quote is None:
|
if quote is None:
|
||||||
quote = self.chat.type != "private"
|
quote = self.chat.type != "private"
|
||||||
@@ -2109,7 +2109,7 @@ class Message(PyrogramType, Update):
|
|||||||
In case the upload is deliberately stopped with :meth:`stop_transmission`, None is returned instead.
|
In case the upload is deliberately stopped with :meth:`stop_transmission`, None is returned instead.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
if quote is None:
|
if quote is None:
|
||||||
quote = self.chat.type != "private"
|
quote = self.chat.type != "private"
|
||||||
@@ -2231,7 +2231,7 @@ class Message(PyrogramType, Update):
|
|||||||
In case the upload is deliberately stopped with :meth:`stop_transmission`, None is returned instead.
|
In case the upload is deliberately stopped with :meth:`stop_transmission`, None is returned instead.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
if quote is None:
|
if quote is None:
|
||||||
quote = self.chat.type != "private"
|
quote = self.chat.type != "private"
|
||||||
@@ -2348,7 +2348,7 @@ class Message(PyrogramType, Update):
|
|||||||
In case the upload is deliberately stopped with :meth:`stop_transmission`, None is returned instead.
|
In case the upload is deliberately stopped with :meth:`stop_transmission`, None is returned instead.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
if quote is None:
|
if quote is None:
|
||||||
quote = self.chat.type != "private"
|
quote = self.chat.type != "private"
|
||||||
@@ -2417,7 +2417,7 @@ class Message(PyrogramType, Update):
|
|||||||
On success, the edited :obj:`Message <pyrogram.Message>` is returned.
|
On success, the edited :obj:`Message <pyrogram.Message>` is returned.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
return self._client.edit_message_text(
|
return self._client.edit_message_text(
|
||||||
chat_id=self.chat.id,
|
chat_id=self.chat.id,
|
||||||
@@ -2472,7 +2472,7 @@ class Message(PyrogramType, Update):
|
|||||||
On success, the edited :obj:`Message <pyrogram.Message>` is returned.
|
On success, the edited :obj:`Message <pyrogram.Message>` is returned.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
return self._client.edit_message_caption(
|
return self._client.edit_message_caption(
|
||||||
chat_id=self.chat.id,
|
chat_id=self.chat.id,
|
||||||
@@ -2511,7 +2511,7 @@ class Message(PyrogramType, Update):
|
|||||||
On success, the edited :obj:`Message <pyrogram.Message>` is returned.
|
On success, the edited :obj:`Message <pyrogram.Message>` is returned.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
return self._client.edit_message_media(
|
return self._client.edit_message_media(
|
||||||
chat_id=self.chat.id,
|
chat_id=self.chat.id,
|
||||||
@@ -2547,7 +2547,7 @@ class Message(PyrogramType, Update):
|
|||||||
:obj:`Message <pyrogram.Message>` is returned, otherwise True is returned.
|
:obj:`Message <pyrogram.Message>` is returned, otherwise True is returned.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
|
:class:`RPCError <pyrogram.RPCError>` in case of a Telegram RPC error.
|
||||||
"""
|
"""
|
||||||
return self._client.edit_message_reply_markup(
|
return self._client.edit_message_reply_markup(
|
||||||
chat_id=self.chat.id,
|
chat_id=self.chat.id,
|
||||||
@@ -2602,7 +2602,7 @@ class Message(PyrogramType, Update):
|
|||||||
On success, the forwarded Message is returned.
|
On success, the forwarded Message is returned.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>`
|
:class:`RPCError <pyrogram.RPCError>`
|
||||||
"""
|
"""
|
||||||
if as_copy:
|
if as_copy:
|
||||||
if self.service:
|
if self.service:
|
||||||
@@ -2732,7 +2732,7 @@ class Message(PyrogramType, Update):
|
|||||||
True on success.
|
True on success.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>`
|
:class:`RPCError <pyrogram.RPCError>`
|
||||||
"""
|
"""
|
||||||
self._client.delete_messages(
|
self._client.delete_messages(
|
||||||
chat_id=self.chat.id,
|
chat_id=self.chat.id,
|
||||||
@@ -2797,7 +2797,7 @@ class Message(PyrogramType, Update):
|
|||||||
button.
|
button.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>`
|
:class:`RPCError <pyrogram.RPCError>`
|
||||||
``ValueError``: If the provided index or position is out of range or the button label was not found
|
``ValueError``: If the provided index or position is out of range or the button label was not found
|
||||||
``TimeoutError``: If, after clicking an inline button, the bot fails to answer within 10 seconds
|
``TimeoutError``: If, after clicking an inline button, the bot fails to answer within 10 seconds
|
||||||
"""
|
"""
|
||||||
@@ -2898,7 +2898,7 @@ class Message(PyrogramType, Update):
|
|||||||
On success, the absolute path of the downloaded file as string is returned, None otherwise.
|
On success, the absolute path of the downloaded file as string is returned, None otherwise.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>`
|
:class:`RPCError <pyrogram.RPCError>`
|
||||||
``ValueError``: If the message doesn't contain any downloadable media
|
``ValueError``: If the message doesn't contain any downloadable media
|
||||||
"""
|
"""
|
||||||
return self._client.download_media(
|
return self._client.download_media(
|
||||||
@@ -2935,7 +2935,7 @@ class Message(PyrogramType, Update):
|
|||||||
True on success.
|
True on success.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>`
|
:class:`RPCError <pyrogram.RPCError>`
|
||||||
"""
|
"""
|
||||||
return self._client.pin_chat_message(
|
return self._client.pin_chat_message(
|
||||||
chat_id=self.chat.id,
|
chat_id=self.chat.id,
|
||||||
|
@@ -149,7 +149,7 @@ class Messages(PyrogramType, Update):
|
|||||||
On success, a :class:`Messages <pyrogram.Messages>` containing forwarded messages is returned.
|
On success, a :class:`Messages <pyrogram.Messages>` containing forwarded messages is returned.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>`
|
:class:`RPCError <pyrogram.RPCError>`
|
||||||
"""
|
"""
|
||||||
forwarded_messages = []
|
forwarded_messages = []
|
||||||
|
|
||||||
|
@@ -21,7 +21,7 @@ from struct import pack
|
|||||||
|
|
||||||
import pyrogram
|
import pyrogram
|
||||||
from pyrogram.api import types, functions
|
from pyrogram.api import types, functions
|
||||||
from pyrogram.api.errors import StickersetInvalid
|
from pyrogram.errors import StickersetInvalid
|
||||||
from .photo_size import PhotoSize
|
from .photo_size import PhotoSize
|
||||||
from ..pyrogram_type import PyrogramType
|
from ..pyrogram_type import PyrogramType
|
||||||
from ...ext.utils import encode
|
from ...ext.utils import encode
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user