mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-16 04:35:24 +00:00
Add system_lang_code to Client and missing enums to SentCodeType (#27)
This commit is contained in:
parent
f783c77368
commit
40ddcbca60
@ -96,6 +96,10 @@ class Client(Methods):
|
||||
Code of the language used on the client, in ISO 639-1 standard.
|
||||
Defaults to "en".
|
||||
|
||||
system_lang_code (``str``, *optional*):
|
||||
Code of the language used on the system, in ISO 639-1 standard.
|
||||
Defaults to "en".
|
||||
|
||||
ipv6 (``bool``, *optional*):
|
||||
Pass True to connect to Telegram using IPv6.
|
||||
Defaults to False (IPv4).
|
||||
@ -193,6 +197,7 @@ class Client(Methods):
|
||||
|
||||
LANG_PACK = ""
|
||||
LANG_CODE = "en"
|
||||
SYSTEM_LANG_CODE = "en"
|
||||
|
||||
PARENT_DIR = Path(sys.argv[0]).parent
|
||||
|
||||
@ -218,6 +223,7 @@ class Client(Methods):
|
||||
system_version: str = SYSTEM_VERSION,
|
||||
lang_pack: str = LANG_PACK,
|
||||
lang_code: str = LANG_CODE,
|
||||
system_lang_code: str = SYSTEM_LANG_CODE,
|
||||
ipv6: bool = False,
|
||||
proxy: dict = None,
|
||||
test_mode: bool = False,
|
||||
@ -248,6 +254,7 @@ class Client(Methods):
|
||||
self.system_version = system_version
|
||||
self.lang_pack = lang_pack.lower()
|
||||
self.lang_code = lang_code.lower()
|
||||
self.system_lang_code = system_lang_code.lower()
|
||||
self.ipv6 = ipv6
|
||||
self.proxy = proxy
|
||||
self.test_mode = test_mode
|
||||
|
@ -43,3 +43,9 @@ class SentCodeType(AutoName):
|
||||
|
||||
EMAIL_CODE = raw.types.auth.SentCodeTypeEmailCode
|
||||
"The code was sent via email."
|
||||
|
||||
FIREBASE_SMS = raw.types.auth.SentCodeTypeFirebaseSms
|
||||
"The code should be delivered via SMS after Firebase attestation."
|
||||
|
||||
SETUP_EMAIL_REQUIRED = raw.types.auth.SentCodeTypeSetUpEmailRequired
|
||||
"The user should add and verify an email address in order to login."
|
||||
|
@ -125,7 +125,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.lang_code,
|
||||
system_lang_code=self.client.system_lang_code,
|
||||
lang_pack=self.client.lang_pack,
|
||||
lang_code=self.client.lang_code,
|
||||
query=raw.functions.help.GetConfig(),
|
||||
|
@ -26,7 +26,7 @@ from .sqlite_storage import SQLiteStorage
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
SCHEMA = """
|
||||
CREATE TABLE usernames
|
||||
CREATE TABLE IF NOT EXISTS usernames
|
||||
(
|
||||
id INTEGER,
|
||||
username TEXT,
|
||||
|
Loading…
Reference in New Issue
Block a user