mirror of
https://github.com/pyrogram/pyrogram
synced 2025-09-05 08:45:13 +00:00
Merge branch 'develop' into asyncio
This commit is contained in:
@@ -31,7 +31,7 @@ __copyright__ = "Copyright (C) 2017-2018 Dan Tès <https://github.com/delivrance
|
||||
"e" if sys.getfilesystemencoding() != "utf-8" else "\xe8"
|
||||
)
|
||||
__license__ = "GNU Lesser General Public License v3 or later (LGPLv3+)"
|
||||
__version__ = "0.7.5.dev5"
|
||||
__version__ = "0.7.5"
|
||||
|
||||
from .api.errors import Error
|
||||
from .client.types import (
|
||||
|
@@ -86,10 +86,6 @@ class Client(Methods, BaseClient):
|
||||
Operating System version. Defaults to *platform.system() + " " + platform.release()*
|
||||
This is an alternative way to set it if you don't want to use the *config.ini* file.
|
||||
|
||||
system_lang_code (``str``, *optional*):
|
||||
Code of the language used on the system, in ISO 639-1 standard. Defaults to "en".
|
||||
This is an alternative way to set it if you don't want to use the *config.ini* file.
|
||||
|
||||
lang_code (``str``, *optional*):
|
||||
Code of the language used on the client, in ISO 639-1 standard. Defaults to "en".
|
||||
This is an alternative way to set it if you don't want to use the *config.ini* file.
|
||||
@@ -149,7 +145,6 @@ class Client(Methods, BaseClient):
|
||||
app_version: str = None,
|
||||
device_model: str = None,
|
||||
system_version: str = None,
|
||||
system_lang_code: str = None,
|
||||
lang_code: str = None,
|
||||
proxy: dict = None,
|
||||
test_mode: bool = False,
|
||||
@@ -170,7 +165,6 @@ class Client(Methods, BaseClient):
|
||||
self.app_version = app_version
|
||||
self.device_model = device_model
|
||||
self.system_version = system_version
|
||||
self.system_lang_code = system_lang_code
|
||||
self.lang_code = lang_code
|
||||
# TODO: Make code consistent, use underscore for private/protected fields
|
||||
self._proxy = proxy
|
||||
@@ -595,6 +589,8 @@ class Client(Methods, BaseClient):
|
||||
self.password = None
|
||||
self.user_id = r.user.id
|
||||
|
||||
print("Login successful")
|
||||
|
||||
def fetch_peers(self, entities: list):
|
||||
for entity in entities:
|
||||
if isinstance(entity, types.User):
|
||||
@@ -887,7 +883,7 @@ class Client(Methods, BaseClient):
|
||||
"More info: https://docs.pyrogram.ml/start/ProjectSetup#configuration"
|
||||
)
|
||||
|
||||
for option in {"app_version", "device_model", "system_version", "system_lang_code", "lang_code"}:
|
||||
for option in {"app_version", "device_model", "system_version", "lang_code"}:
|
||||
if getattr(self, option):
|
||||
pass
|
||||
else:
|
||||
|
@@ -516,7 +516,8 @@ class Message(Object):
|
||||
|
||||
Raises:
|
||||
:class:`Error <pyrogram.Error>`
|
||||
``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
|
||||
"""
|
||||
if isinstance(self.reply_markup, ReplyKeyboardMarkup):
|
||||
if quote is None:
|
||||
@@ -561,7 +562,7 @@ class Message(Object):
|
||||
return await self._client.request_callback_answer(
|
||||
chat_id=self.chat.id,
|
||||
message_id=self.message_id,
|
||||
data=button.callback_data
|
||||
callback_data=button.callback_data
|
||||
)
|
||||
elif button.url:
|
||||
return button.url
|
||||
|
@@ -132,7 +132,7 @@ class Session:
|
||||
app_version=self.client.app_version,
|
||||
device_model=self.client.device_model,
|
||||
system_version=self.client.system_version,
|
||||
system_lang_code=self.client.system_lang_code,
|
||||
system_lang_code=self.client.lang_code,
|
||||
lang_code=self.client.lang_code,
|
||||
lang_pack="",
|
||||
query=functions.help.GetConfig(),
|
||||
|
Reference in New Issue
Block a user