mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-06-17 10:36:37 +00:00
Make able to specify lang_pack and avoid ban tip.
This commit is contained in:
parent
77b7edcd6e
commit
f0cc95caa2
@ -103,6 +103,21 @@ when sending a message to some accounts but not others.
|
|||||||
|
|
||||||
For more discussion, please see `issue 297`_.
|
For more discussion, please see `issue 297`_.
|
||||||
|
|
||||||
|
Or you can just use official Telegram Desktop session params
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
client = TelegramClient(
|
||||||
|
session='session',
|
||||||
|
api_id = 2040,
|
||||||
|
api_hash = "b18441a1ff607e10a989891a5462e627",
|
||||||
|
device_model = "Desktop",
|
||||||
|
system_version = "Windows 11",
|
||||||
|
app_version = "5.13.1 x64", # use latest version if possible
|
||||||
|
lang_code = "en",
|
||||||
|
system_lang_code = "en-US",
|
||||||
|
lang_pack = "tdesktop",
|
||||||
|
)
|
||||||
|
|
||||||
How can I use a proxy?
|
How can I use a proxy?
|
||||||
======================
|
======================
|
||||||
|
@ -257,6 +257,7 @@ class TelegramBaseClient(abc.ABC):
|
|||||||
app_version: str = None,
|
app_version: str = None,
|
||||||
lang_code: str = 'en',
|
lang_code: str = 'en',
|
||||||
system_lang_code: str = 'en',
|
system_lang_code: str = 'en',
|
||||||
|
lang_pack: str = '',
|
||||||
loop: asyncio.AbstractEventLoop = None,
|
loop: asyncio.AbstractEventLoop = None,
|
||||||
base_logger: typing.Union[str, logging.Logger] = None,
|
base_logger: typing.Union[str, logging.Logger] = None,
|
||||||
receive_updates: bool = True,
|
receive_updates: bool = True,
|
||||||
@ -391,7 +392,7 @@ class TelegramBaseClient(abc.ABC):
|
|||||||
app_version=app_version or self.__version__,
|
app_version=app_version or self.__version__,
|
||||||
lang_code=lang_code,
|
lang_code=lang_code,
|
||||||
system_lang_code=system_lang_code,
|
system_lang_code=system_lang_code,
|
||||||
lang_pack='', # "langPacks are for official apps only"
|
lang_pack=lang_pack, # "langPacks are for official apps only"
|
||||||
query=None,
|
query=None,
|
||||||
proxy=init_proxy
|
proxy=init_proxy
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user