yeref 0.28.98__tar.gz → 0.29.1__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.98 → yeref-0.29.1}/PKG-INFO +1 -1
- {yeref-0.28.98 → yeref-0.29.1}/setup.py +1 -1
- {yeref-0.28.98 → yeref-0.29.1}/yeref/l_.py +0 -1
- {yeref-0.28.98 → yeref-0.29.1}/yeref/yeref.py +58 -52
- {yeref-0.28.98 → yeref-0.29.1}/yeref.egg-info/PKG-INFO +1 -1
- {yeref-0.28.98 → yeref-0.29.1}/pyproject.toml +0 -0
- {yeref-0.28.98 → yeref-0.29.1}/setup.cfg +0 -0
- {yeref-0.28.98 → yeref-0.29.1}/yeref/__init__.py +0 -0
- {yeref-0.28.98 → yeref-0.29.1}/yeref/tonweb.js +0 -0
- {yeref-0.28.98 → yeref-0.29.1}/yeref.egg-info/SOURCES.txt +0 -0
- {yeref-0.28.98 → yeref-0.29.1}/yeref.egg-info/dependency_links.txt +0 -0
- {yeref-0.28.98 → yeref-0.29.1}/yeref.egg-info/top_level.txt +0 -0
@@ -265,8 +265,13 @@ GROUPP_CUSER_ = '☐☑'
|
|
265
265
|
GROUPP_CADMIN_ = '☑☐'
|
266
266
|
GROUPP_CPAY_ = '☐☐☐'
|
267
267
|
GROUPP_CCOMMENT_ = '☑☑'
|
268
|
-
|
268
|
+
GROUPP_CDIALOG_ = '☑☐☐'
|
269
269
|
GROUPP_CSYSTEM_ = '☑'
|
270
|
+
GROUPP_CCHANNEL_ = '☑☑'
|
271
|
+
GROUPP_CLINK_ = '☑☑☑'
|
272
|
+
GROUPP_CSYMBOLS_ = '☑☑☑'
|
273
|
+
GROUPP_CWORDS_ = '☐☐'
|
274
|
+
GROUPP_CVOTE_ = '☑☑'
|
270
275
|
|
271
276
|
CHANNEL_CONFIG_ = '☑☑☑☐☐☐☐'
|
272
277
|
CHANNEL_CCHECK_ = '☑☐☐☐☐'
|
@@ -7834,7 +7839,7 @@ async def upd_user_data_main(data, web_app_init_data, BASE_P, BOT_TOKEN_E18B, re
|
|
7834
7839
|
page = data.get('page', '')
|
7835
7840
|
connectedAddress = data.get('connectedAddress', '')
|
7836
7841
|
USER_TID = chat_id
|
7837
|
-
|
7842
|
+
USER_HID = USER_LZ = USER_DT = None
|
7838
7843
|
USER_VARS = json.loads(USER_VARS_)
|
7839
7844
|
USER_LSTS = json.loads(USER_LSTS_)
|
7840
7845
|
USER_GAMES = {}
|
@@ -7844,45 +7849,43 @@ async def upd_user_data_main(data, web_app_init_data, BASE_P, BOT_TOKEN_E18B, re
|
|
7844
7849
|
|
7845
7850
|
print(f"upd_user_data_main: {lc=}, {USER_LSTS=}")
|
7846
7851
|
try:
|
7847
|
-
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 "
|
7848
7853
|
f"FROM \"USER\" WHERE USER_TID=$1")
|
7849
7854
|
data_user = await db_select_pg(sql, (chat_id,), BASE_P)
|
7850
7855
|
|
7851
7856
|
# region data
|
7852
7857
|
if len(data_user):
|
7853
|
-
USER_TID, USER_HID,
|
7858
|
+
USER_TID, USER_HID, USER_LZ, USER_DT, USER_GAMES, USER_VARS, USER_LSTS = data_user[0]
|
7854
7859
|
USER_GAMES = json.loads(USER_GAMES)
|
7855
7860
|
USER_VARS = json.loads(USER_VARS)
|
7856
7861
|
USER_LSTS = json.loads(USER_LSTS)
|
7857
7862
|
if page in ['msg', 'pst']: USER_GAMES = await ch_games(USER_GAMES, 'web', True, balls)
|
7858
7863
|
|
7859
|
-
if lc:
|
7860
|
-
USER_VARS['USER_LC'] = lc
|
7861
|
-
lz = 'en'
|
7862
|
-
if lc in ['zh', 'zh-chs', 'zh-cht', 'ja', 'ko', 'zh-CN', 'zh-TW', 'th', 'vi', 'tw', 'sg']:
|
7863
|
-
lz = 'zh'
|
7864
|
-
# arabic # ir, af
|
7865
|
-
elif lc in ['ar-XA', 'ar', 'tr', 'ur', 'fa', 'tj', 'dz', 'eg', 'iq', 'sy', 'ae', 'sa', 'tn', 'ir',
|
7866
|
-
'af']:
|
7867
|
-
lz = 'ar'
|
7868
|
-
# spanish # portugal: 'pt', 'br', 'ao', 'mz'
|
7869
|
-
elif lc in ['es', 'ar', 'cl', 'co', 'cu', 've', 'bo', 'pe', 'ec', 'pt', 'br', 'ao', 'mz']:
|
7870
|
-
lz = 'es'
|
7871
|
-
# french
|
7872
|
-
elif lc in ['fr', 'ch', 'be', 'ca']:
|
7873
|
-
lz = 'fr'
|
7874
|
-
# europe
|
7875
|
-
elif lc in ['ru', 'kz', 'kg', 'uz', 'tm', 'md', 'am', 'uk-UA', 'uk', 'kk', 'tk', 'ky']:
|
7876
|
-
lz = 'ru'
|
7877
|
-
USER_VARS['USER_LZ'] = lz if not USER_LZ else USER_LZ
|
7878
|
-
|
7879
7864
|
now = datetime.now(timezone.utc)
|
7880
7865
|
USER_LSTS["USER_DAU"] = list(set(USER_LSTS.get("USER_DAU", []) + [now.strftime('%Y-%m-%d')]))
|
7881
7866
|
USER_LSTS["USER_MAU"] = list(set(USER_LSTS.get("USER_MAU", []) + [now.strftime('%Y-%m')]))
|
7882
7867
|
USER_VARS['USER_SIG'] = usr_sig
|
7883
7868
|
USER_VARS['USER_ISPREMIUM'] = is_premium
|
7884
|
-
lz = USER_VARS.get('USER_LZ', 'en')
|
7885
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
|
7886
7889
|
if not USER_DT:
|
7887
7890
|
USER_VARS['USER_DT'] = USER_DT = datetime.now(timezone.utc).strftime("%d-%m-%Y_%H-%M-%S")
|
7888
7891
|
USER_HID = hashlib.blake2b(f"{'tid'}-{chat_id}".encode('utf-8'), digest_size=4).hexdigest()
|
@@ -7956,11 +7959,12 @@ async def upd_user_data_main(data, web_app_init_data, BASE_P, BOT_TOKEN_E18B, re
|
|
7956
7959
|
USER_ISPREMIUM = EXCLUDED.USER_ISPREMIUM,
|
7957
7960
|
USER_LZ = EXCLUDED.USER_LZ,
|
7958
7961
|
USER_DT = EXCLUDED.USER_DT,
|
7962
|
+
|
7959
7963
|
USER_GAMES = EXCLUDED.USER_GAMES,
|
7960
7964
|
USER_VARS = EXCLUDED.USER_VARS,
|
7961
7965
|
USER_LSTS = EXCLUDED.USER_LSTS
|
7962
7966
|
"""
|
7963
|
-
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,
|
7964
7968
|
json.dumps(USER_GAMES, ensure_ascii=False),
|
7965
7969
|
json.dumps(USER_VARS, ensure_ascii=False),
|
7966
7970
|
json.dumps(USER_LSTS, ensure_ascii=False),), BASE_P)
|
@@ -7984,7 +7988,7 @@ async def upd_user_data(ENT_TID, data, web_app_init_data, PROJECT_USERNAME, BASE
|
|
7984
7988
|
page = data.get('page', '')
|
7985
7989
|
connectedAddress = data.get('connectedAddress', '')
|
7986
7990
|
USER_TID = chat_id
|
7987
|
-
|
7991
|
+
USER_HID = USER_LZ = USER_DT = None
|
7988
7992
|
USER_VARS = json.loads(USER_VARS_)
|
7989
7993
|
USER_LSTS = json.loads(USER_LSTS_)
|
7990
7994
|
USER_GAMES = {}
|
@@ -8003,43 +8007,43 @@ async def upd_user_data(ENT_TID, data, web_app_init_data, PROJECT_USERNAME, BASE
|
|
8003
8007
|
elif PROJECT_USERNAME == 'FereyUserBot':
|
8004
8008
|
schema_name = 'UB'
|
8005
8009
|
|
8006
|
-
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 "
|
8007
8011
|
f"FROM {schema_name}_{tid}.USER WHERE USER_TID=$1")
|
8008
8012
|
data_user = await db_select_pg(sql, (chat_id,), BASE_P)
|
8009
8013
|
|
8010
8014
|
# region data
|
8011
8015
|
if len(data_user):
|
8012
|
-
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]
|
8013
8017
|
USER_GAMES = json.loads(USER_GAMES)
|
8014
8018
|
USER_VARS = json.loads(USER_VARS)
|
8015
8019
|
USER_LSTS = json.loads(USER_LSTS)
|
8016
8020
|
if page in ['msg', 'pst']: USER_GAMES = await ch_games(USER_GAMES, 'web', True, balls)
|
8017
8021
|
|
8018
|
-
if lc:
|
8019
|
-
USER_VARS['USER_LC'] = lc
|
8020
|
-
lz = 'en'
|
8021
|
-
if lc in ['zh', 'zh-chs', 'zh-cht', 'ja', 'ko', 'zh-CN', 'zh-TW', 'th', 'vi', 'tw', 'sg']:
|
8022
|
-
lz = 'zh'
|
8023
|
-
# arabic # ir, af
|
8024
|
-
elif lc in ['ar-XA', 'ar', 'tr', 'ur', 'fa', 'tj', 'dz', 'eg', 'iq', 'sy', 'ae', 'sa', 'tn', 'ir',
|
8025
|
-
'af']:
|
8026
|
-
lz = 'ar'
|
8027
|
-
# spanish # portugal: 'pt', 'br', 'ao', 'mz'
|
8028
|
-
elif lc in ['es', 'ar', 'cl', 'co', 'cu', 've', 'bo', 'pe', 'ec', 'pt', 'br', 'ao', 'mz']:
|
8029
|
-
lz = 'es'
|
8030
|
-
# french
|
8031
|
-
elif lc in ['fr', 'ch', 'be', 'ca']:
|
8032
|
-
lz = 'fr'
|
8033
|
-
# europe
|
8034
|
-
elif lc in ['ru', 'kz', 'kg', 'uz', 'tm', 'md', 'am', 'uk-UA', 'uk', 'kk', 'tk', 'ky']:
|
8035
|
-
lz = 'ru'
|
8036
|
-
USER_VARS['USER_LZ'] = lz
|
8037
|
-
|
8038
8022
|
now = datetime.now(timezone.utc)
|
8039
8023
|
USER_LSTS["USER_DAU"] = list(set(USER_LSTS.get("USER_DAU", []) + [now.strftime('%Y-%m-%d')]))
|
8040
8024
|
USER_LSTS["USER_MAU"] = list(set(USER_LSTS.get("USER_MAU", []) + [now.strftime('%Y-%m')]))
|
8041
8025
|
USER_VARS['USER_SIG'] = usr_sig
|
8042
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
|
8043
8047
|
if not USER_DT: USER_VARS['USER_DT'] = USER_DT = datetime.now(timezone.utc).strftime("%d-%m-%Y_%H-%M-%S")
|
8044
8048
|
if not USER_HID: USER_HID = hashlib.blake2b(f"{tid}-{chat_id}".encode('utf-8'), digest_size=4).hexdigest()
|
8045
8049
|
# endregion
|
@@ -8070,21 +8074,23 @@ async def upd_user_data(ENT_TID, data, web_app_init_data, PROJECT_USERNAME, BASE
|
|
8070
8074
|
sql = f"""
|
8071
8075
|
INSERT INTO {schema_name}_{tid}.USER (
|
8072
8076
|
USER_TID, USER_HID, USER_USERNAME, USER_FULLNAME, USER_ISPREMIUM,
|
8073
|
-
USER_DT, USER_GAMES, USER_VARS, USER_LSTS
|
8077
|
+
USER_LZ, USER_DT, USER_GAMES, USER_VARS, USER_LSTS
|
8074
8078
|
)
|
8075
|
-
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9)
|
8079
|
+
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10)
|
8076
8080
|
ON CONFLICT (USER_TID) DO UPDATE
|
8077
8081
|
SET
|
8078
8082
|
USER_HID = EXCLUDED.USER_HID,
|
8079
8083
|
USER_USERNAME = EXCLUDED.USER_USERNAME,
|
8080
8084
|
USER_FULLNAME = EXCLUDED.USER_FULLNAME,
|
8081
8085
|
USER_ISPREMIUM = EXCLUDED.USER_ISPREMIUM,
|
8086
|
+
USER_LZ = EXCLUDED.USER_LZ,
|
8082
8087
|
USER_DT = EXCLUDED.USER_DT,
|
8088
|
+
|
8083
8089
|
USER_GAMES = EXCLUDED.USER_GAMES,
|
8084
8090
|
USER_VARS = EXCLUDED.USER_VARS,
|
8085
8091
|
USER_LSTS = EXCLUDED.USER_LSTS
|
8086
8092
|
"""
|
8087
|
-
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,
|
8088
8094
|
json.dumps(USER_GAMES, ensure_ascii=False),
|
8089
8095
|
json.dumps(USER_VARS, ensure_ascii=False),
|
8090
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
|