yeref 0.28.99__tar.gz → 0.29.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {yeref-0.28.99 → yeref-0.29.2}/PKG-INFO +1 -1
- {yeref-0.28.99 → yeref-0.29.2}/setup.py +1 -1
- {yeref-0.28.99 → yeref-0.29.2}/yeref/yeref.py +53 -52
- {yeref-0.28.99 → yeref-0.29.2}/yeref.egg-info/PKG-INFO +1 -1
- {yeref-0.28.99 → yeref-0.29.2}/pyproject.toml +0 -0
- {yeref-0.28.99 → yeref-0.29.2}/setup.cfg +0 -0
- {yeref-0.28.99 → yeref-0.29.2}/yeref/__init__.py +0 -0
- {yeref-0.28.99 → yeref-0.29.2}/yeref/l_.py +0 -0
- {yeref-0.28.99 → yeref-0.29.2}/yeref/tonweb.js +0 -0
- {yeref-0.28.99 → yeref-0.29.2}/yeref.egg-info/SOURCES.txt +0 -0
- {yeref-0.28.99 → yeref-0.29.2}/yeref.egg-info/dependency_links.txt +0 -0
- {yeref-0.28.99 → yeref-0.29.2}/yeref.egg-info/top_level.txt +0 -0
@@ -7839,7 +7839,7 @@ async def upd_user_data_main(data, web_app_init_data, BASE_P, BOT_TOKEN_E18B, re
|
|
7839
7839
|
page = data.get('page', '')
|
7840
7840
|
connectedAddress = data.get('connectedAddress', '')
|
7841
7841
|
USER_TID = chat_id
|
7842
|
-
|
7842
|
+
USER_HID = USER_LZ = USER_DT = None
|
7843
7843
|
USER_VARS = json.loads(USER_VARS_)
|
7844
7844
|
USER_LSTS = json.loads(USER_LSTS_)
|
7845
7845
|
USER_GAMES = {}
|
@@ -7849,45 +7849,43 @@ async def upd_user_data_main(data, web_app_init_data, BASE_P, BOT_TOKEN_E18B, re
|
|
7849
7849
|
|
7850
7850
|
print(f"upd_user_data_main: {lc=}, {USER_LSTS=}")
|
7851
7851
|
try:
|
7852
|
-
sql = (f"SELECT USER_TID, USER_HID,
|
7852
|
+
sql = (f"SELECT USER_TID, USER_HID, USER_LZ, USER_DT, USER_GAMES, USER_VARS, USER_LSTS "
|
7853
7853
|
f"FROM \"USER\" WHERE USER_TID=$1")
|
7854
7854
|
data_user = await db_select_pg(sql, (chat_id,), BASE_P)
|
7855
7855
|
|
7856
7856
|
# region data
|
7857
7857
|
if len(data_user):
|
7858
|
-
USER_TID, USER_HID,
|
7858
|
+
USER_TID, USER_HID, USER_LZ, USER_DT, USER_GAMES, USER_VARS, USER_LSTS = data_user[0]
|
7859
7859
|
USER_GAMES = json.loads(USER_GAMES)
|
7860
7860
|
USER_VARS = json.loads(USER_VARS)
|
7861
7861
|
USER_LSTS = json.loads(USER_LSTS)
|
7862
7862
|
if page in ['msg', 'pst']: USER_GAMES = await ch_games(USER_GAMES, 'web', True, balls)
|
7863
7863
|
|
7864
|
-
if lc:
|
7865
|
-
USER_VARS['USER_LC'] = lc
|
7866
|
-
lz = 'en'
|
7867
|
-
if lc in ['zh', 'zh-chs', 'zh-cht', 'ja', 'ko', 'zh-CN', 'zh-TW', 'th', 'vi', 'tw', 'sg']:
|
7868
|
-
lz = 'zh'
|
7869
|
-
# arabic # ir, af
|
7870
|
-
elif lc in ['ar-XA', 'ar', 'tr', 'ur', 'fa', 'tj', 'dz', 'eg', 'iq', 'sy', 'ae', 'sa', 'tn', 'ir',
|
7871
|
-
'af']:
|
7872
|
-
lz = 'ar'
|
7873
|
-
# spanish # portugal: 'pt', 'br', 'ao', 'mz'
|
7874
|
-
elif lc in ['es', 'ar', 'cl', 'co', 'cu', 've', 'bo', 'pe', 'ec', 'pt', 'br', 'ao', 'mz']:
|
7875
|
-
lz = 'es'
|
7876
|
-
# french
|
7877
|
-
elif lc in ['fr', 'ch', 'be', 'ca']:
|
7878
|
-
lz = 'fr'
|
7879
|
-
# europe
|
7880
|
-
elif lc in ['ru', 'kz', 'kg', 'uz', 'tm', 'md', 'am', 'uk-UA', 'uk', 'kk', 'tk', 'ky']:
|
7881
|
-
lz = 'ru'
|
7882
|
-
USER_VARS['USER_LZ'] = lz if not USER_LZ else USER_LZ
|
7883
|
-
|
7884
7864
|
now = datetime.now(timezone.utc)
|
7885
7865
|
USER_LSTS["USER_DAU"] = list(set(USER_LSTS.get("USER_DAU", []) + [now.strftime('%Y-%m-%d')]))
|
7886
7866
|
USER_LSTS["USER_MAU"] = list(set(USER_LSTS.get("USER_MAU", []) + [now.strftime('%Y-%m')]))
|
7887
7867
|
USER_VARS['USER_SIG'] = usr_sig
|
7888
7868
|
USER_VARS['USER_ISPREMIUM'] = is_premium
|
7889
|
-
lz = USER_VARS.get('USER_LZ', 'en')
|
7890
7869
|
|
7870
|
+
if not USER_LZ:
|
7871
|
+
USER_VARS['USER_LC'] = lc
|
7872
|
+
lz = 'en'
|
7873
|
+
if lc in ['zh', 'zh-chs', 'zh-cht', 'ja', 'ko', 'zh-CN', 'zh-TW', 'th', 'vi', 'tw', 'sg']:
|
7874
|
+
lz = 'zh'
|
7875
|
+
# arabic # ir, af
|
7876
|
+
elif lc in ['ar-XA', 'ar', 'tr', 'ur', 'fa', 'tj', 'dz', 'eg', 'iq', 'sy', 'ae', 'sa', 'tn', 'ir',
|
7877
|
+
'af']:
|
7878
|
+
lz = 'ar'
|
7879
|
+
# spanish # portugal: 'pt', 'br', 'ao', 'mz'
|
7880
|
+
elif lc in ['es', 'ar', 'cl', 'co', 'cu', 've', 'bo', 'pe', 'ec', 'pt', 'br', 'ao', 'mz']:
|
7881
|
+
lz = 'es'
|
7882
|
+
# french
|
7883
|
+
elif lc in ['fr', 'ch', 'be', 'ca']:
|
7884
|
+
lz = 'fr'
|
7885
|
+
# europe
|
7886
|
+
elif lc in ['ru', 'kz', 'kg', 'uz', 'tm', 'md', 'am', 'uk-UA', 'uk', 'kk', 'tk', 'ky']:
|
7887
|
+
lz = 'ru'
|
7888
|
+
USER_VARS['USER_LZ'] = USER_LZ = lz
|
7891
7889
|
if not USER_DT:
|
7892
7890
|
USER_VARS['USER_DT'] = USER_DT = datetime.now(timezone.utc).strftime("%d-%m-%Y_%H-%M-%S")
|
7893
7891
|
USER_HID = hashlib.blake2b(f"{'tid'}-{chat_id}".encode('utf-8'), digest_size=4).hexdigest()
|
@@ -7936,7 +7934,7 @@ async def upd_user_data_main(data, web_app_init_data, BASE_P, BOT_TOKEN_E18B, re
|
|
7936
7934
|
if not is_paid:
|
7937
7935
|
extra_bot = None
|
7938
7936
|
try:
|
7939
|
-
lib_id = channel_library_ru if
|
7937
|
+
lib_id = channel_library_ru if USER_LZ == 'ru' else channel_library_en
|
7940
7938
|
print(f"{channel_library_ru=}, {channel_library_en=}")
|
7941
7939
|
extra_bot = Bot(token=BOT_TOKEN_E18B)
|
7942
7940
|
member_ = await extra_bot.get_chat_member(chat_id=lib_id, user_id=chat_id)
|
@@ -7961,11 +7959,12 @@ async def upd_user_data_main(data, web_app_init_data, BASE_P, BOT_TOKEN_E18B, re
|
|
7961
7959
|
USER_ISPREMIUM = EXCLUDED.USER_ISPREMIUM,
|
7962
7960
|
USER_LZ = EXCLUDED.USER_LZ,
|
7963
7961
|
USER_DT = EXCLUDED.USER_DT,
|
7962
|
+
|
7964
7963
|
USER_GAMES = EXCLUDED.USER_GAMES,
|
7965
7964
|
USER_VARS = EXCLUDED.USER_VARS,
|
7966
7965
|
USER_LSTS = EXCLUDED.USER_LSTS
|
7967
7966
|
"""
|
7968
|
-
await db_change_pg(sql, (USER_TID, USER_HID, username, full_name, is_premium,
|
7967
|
+
await db_change_pg(sql, (USER_TID, USER_HID, username, full_name, is_premium, USER_LZ, USER_DT,
|
7969
7968
|
json.dumps(USER_GAMES, ensure_ascii=False),
|
7970
7969
|
json.dumps(USER_VARS, ensure_ascii=False),
|
7971
7970
|
json.dumps(USER_LSTS, ensure_ascii=False),), BASE_P)
|
@@ -7989,7 +7988,7 @@ async def upd_user_data(ENT_TID, data, web_app_init_data, PROJECT_USERNAME, BASE
|
|
7989
7988
|
page = data.get('page', '')
|
7990
7989
|
connectedAddress = data.get('connectedAddress', '')
|
7991
7990
|
USER_TID = chat_id
|
7992
|
-
|
7991
|
+
USER_HID = USER_LZ = USER_DT = None
|
7993
7992
|
USER_VARS = json.loads(USER_VARS_)
|
7994
7993
|
USER_LSTS = json.loads(USER_LSTS_)
|
7995
7994
|
USER_GAMES = {}
|
@@ -8008,43 +8007,43 @@ async def upd_user_data(ENT_TID, data, web_app_init_data, PROJECT_USERNAME, BASE
|
|
8008
8007
|
elif PROJECT_USERNAME == 'FereyUserBot':
|
8009
8008
|
schema_name = 'UB'
|
8010
8009
|
|
8011
|
-
sql = (f"SELECT USER_TID, USER_HID, USER_DT, USER_GAMES, USER_VARS, USER_LSTS "
|
8010
|
+
sql = (f"SELECT USER_TID, USER_HID, USER_LZ, USER_DT, USER_GAMES, USER_VARS, USER_LSTS "
|
8012
8011
|
f"FROM {schema_name}_{tid}.USER WHERE USER_TID=$1")
|
8013
8012
|
data_user = await db_select_pg(sql, (chat_id,), BASE_P)
|
8014
8013
|
|
8015
8014
|
# region data
|
8016
8015
|
if len(data_user):
|
8017
|
-
USER_TID, USER_HID, USER_DT, USER_GAMES, USER_VARS, USER_LSTS = data_user[0]
|
8016
|
+
USER_TID, USER_HID, USER_LZ, USER_DT, USER_GAMES, USER_VARS, USER_LSTS = data_user[0]
|
8018
8017
|
USER_GAMES = json.loads(USER_GAMES)
|
8019
8018
|
USER_VARS = json.loads(USER_VARS)
|
8020
8019
|
USER_LSTS = json.loads(USER_LSTS)
|
8021
8020
|
if page in ['msg', 'pst']: USER_GAMES = await ch_games(USER_GAMES, 'web', True, balls)
|
8022
8021
|
|
8023
|
-
if lc:
|
8024
|
-
USER_VARS['USER_LC'] = lc
|
8025
|
-
lz = 'en'
|
8026
|
-
if lc in ['zh', 'zh-chs', 'zh-cht', 'ja', 'ko', 'zh-CN', 'zh-TW', 'th', 'vi', 'tw', 'sg']:
|
8027
|
-
lz = 'zh'
|
8028
|
-
# arabic # ir, af
|
8029
|
-
elif lc in ['ar-XA', 'ar', 'tr', 'ur', 'fa', 'tj', 'dz', 'eg', 'iq', 'sy', 'ae', 'sa', 'tn', 'ir',
|
8030
|
-
'af']:
|
8031
|
-
lz = 'ar'
|
8032
|
-
# spanish # portugal: 'pt', 'br', 'ao', 'mz'
|
8033
|
-
elif lc in ['es', 'ar', 'cl', 'co', 'cu', 've', 'bo', 'pe', 'ec', 'pt', 'br', 'ao', 'mz']:
|
8034
|
-
lz = 'es'
|
8035
|
-
# french
|
8036
|
-
elif lc in ['fr', 'ch', 'be', 'ca']:
|
8037
|
-
lz = 'fr'
|
8038
|
-
# europe
|
8039
|
-
elif lc in ['ru', 'kz', 'kg', 'uz', 'tm', 'md', 'am', 'uk-UA', 'uk', 'kk', 'tk', 'ky']:
|
8040
|
-
lz = 'ru'
|
8041
|
-
USER_VARS['USER_LZ'] = lz
|
8042
|
-
|
8043
8022
|
now = datetime.now(timezone.utc)
|
8044
8023
|
USER_LSTS["USER_DAU"] = list(set(USER_LSTS.get("USER_DAU", []) + [now.strftime('%Y-%m-%d')]))
|
8045
8024
|
USER_LSTS["USER_MAU"] = list(set(USER_LSTS.get("USER_MAU", []) + [now.strftime('%Y-%m')]))
|
8046
8025
|
USER_VARS['USER_SIG'] = usr_sig
|
8047
8026
|
USER_VARS['USER_ISPREMIUM'] = is_premium
|
8027
|
+
|
8028
|
+
if not USER_LZ:
|
8029
|
+
USER_VARS['USER_LC'] = lc
|
8030
|
+
lz = 'en'
|
8031
|
+
if lc in ['zh', 'zh-chs', 'zh-cht', 'ja', 'ko', 'zh-CN', 'zh-TW', 'th', 'vi', 'tw', 'sg']:
|
8032
|
+
lz = 'zh'
|
8033
|
+
# arabic # ir, af
|
8034
|
+
elif lc in ['ar-XA', 'ar', 'tr', 'ur', 'fa', 'tj', 'dz', 'eg', 'iq', 'sy', 'ae', 'sa', 'tn', 'ir',
|
8035
|
+
'af']:
|
8036
|
+
lz = 'ar'
|
8037
|
+
# spanish # portugal: 'pt', 'br', 'ao', 'mz'
|
8038
|
+
elif lc in ['es', 'ar', 'cl', 'co', 'cu', 've', 'bo', 'pe', 'ec', 'pt', 'br', 'ao', 'mz']:
|
8039
|
+
lz = 'es'
|
8040
|
+
# french
|
8041
|
+
elif lc in ['fr', 'ch', 'be', 'ca']:
|
8042
|
+
lz = 'fr'
|
8043
|
+
# europe
|
8044
|
+
elif lc in ['ru', 'kz', 'kg', 'uz', 'tm', 'md', 'am', 'uk-UA', 'uk', 'kk', 'tk', 'ky']:
|
8045
|
+
lz = 'ru'
|
8046
|
+
USER_VARS['USER_LZ'] = USER_LZ = lz
|
8048
8047
|
if not USER_DT: USER_VARS['USER_DT'] = USER_DT = datetime.now(timezone.utc).strftime("%d-%m-%Y_%H-%M-%S")
|
8049
8048
|
if not USER_HID: USER_HID = hashlib.blake2b(f"{tid}-{chat_id}".encode('utf-8'), digest_size=4).hexdigest()
|
8050
8049
|
# endregion
|
@@ -8075,21 +8074,23 @@ async def upd_user_data(ENT_TID, data, web_app_init_data, PROJECT_USERNAME, BASE
|
|
8075
8074
|
sql = f"""
|
8076
8075
|
INSERT INTO {schema_name}_{tid}.USER (
|
8077
8076
|
USER_TID, USER_HID, USER_USERNAME, USER_FULLNAME, USER_ISPREMIUM,
|
8078
|
-
USER_DT, USER_GAMES, USER_VARS, USER_LSTS
|
8077
|
+
USER_LZ, USER_DT, USER_GAMES, USER_VARS, USER_LSTS
|
8079
8078
|
)
|
8080
|
-
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9)
|
8079
|
+
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10)
|
8081
8080
|
ON CONFLICT (USER_TID) DO UPDATE
|
8082
8081
|
SET
|
8083
8082
|
USER_HID = EXCLUDED.USER_HID,
|
8084
8083
|
USER_USERNAME = EXCLUDED.USER_USERNAME,
|
8085
8084
|
USER_FULLNAME = EXCLUDED.USER_FULLNAME,
|
8086
8085
|
USER_ISPREMIUM = EXCLUDED.USER_ISPREMIUM,
|
8086
|
+
USER_LZ = EXCLUDED.USER_LZ,
|
8087
8087
|
USER_DT = EXCLUDED.USER_DT,
|
8088
|
+
|
8088
8089
|
USER_GAMES = EXCLUDED.USER_GAMES,
|
8089
8090
|
USER_VARS = EXCLUDED.USER_VARS,
|
8090
8091
|
USER_LSTS = EXCLUDED.USER_LSTS
|
8091
8092
|
"""
|
8092
|
-
await db_change_pg(sql, (USER_TID, USER_HID, username, full_name, is_premium, USER_DT,
|
8093
|
+
await db_change_pg(sql, (USER_TID, USER_HID, username, full_name, is_premium, USER_LZ, USER_DT,
|
8093
8094
|
json.dumps(USER_GAMES, ensure_ascii=False),
|
8094
8095
|
json.dumps(USER_VARS, ensure_ascii=False),
|
8095
8096
|
json.dumps(USER_LSTS, ensure_ascii=False),), BASE_P)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|