yeref 0.29.58__py3-none-any.whl → 0.29.60__py3-none-any.whl

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/yeref.py CHANGED
@@ -2586,7 +2586,7 @@ async def db_select_pg(sql, param=None, db_pool=None, db_config=None):
2586
2586
  elif "SELECT NOTICE_ID, NOTICE_TYPE, NOTICE_TXT" in sql: pass
2587
2587
  elif "<= NOW()" in sql: pass
2588
2588
  elif "_LZ FROM" in sql: pass
2589
- elif "GROUPP_CWORKPERMISSIONS FROM" in sql: pass
2589
+ elif "GROUPP_CVOTERESTRICT FROM" in sql: pass
2590
2590
  else:
2591
2591
  logger.info(log_ % f"SQL: {sql}, PARAM: {param}")
2592
2592
  else:
@@ -7800,7 +7800,7 @@ async def upd_user_data_main(data, web_app_init_data, BASE_P, BOT_TOKEN_E18B, re
7800
7800
  if not USER_DT:
7801
7801
  USER_DT = now_
7802
7802
  USER_VARS['USER_DT'] = USER_DT.strftime("%d-%m-%Y_%H-%M-%S")
7803
- USER_HID = hashlib.blake2b(f"{'tid'}-{chat_id}".encode('utf-8'), digest_size=4).hexdigest()
7803
+ USER_HID = hashlib.blake2b(f"{chat_id}-{chat_id}".encode('utf-8'), digest_size=4).hexdigest()
7804
7804
  if utm: USER_VARS['USER_UTM'] = utm
7805
7805
 
7806
7806
  USER_LSTS["USER_DAU"] = list(set(USER_LSTS.get("USER_DAU", []) + [now_.strftime('%Y-%m-%d')]))
@@ -7959,9 +7959,10 @@ async def upd_user_data(ENT_TID, data, web_app_init_data, PROJECT_USERNAME, BASE
7959
7959
  if not USER_DT:
7960
7960
  USER_DT = now_
7961
7961
  USER_VARS['USER_DT'] = USER_DT.strftime("%d-%m-%Y_%H-%M-%S")
7962
- USER_HID = hashlib.blake2b(f"{'tid'}-{chat_id}".encode('utf-8'), digest_size=4).hexdigest()
7962
+ USER_HID = hashlib.blake2b(f"{tid}-{chat_id}".encode('utf-8'), digest_size=4).hexdigest()
7963
7963
  if req_url: USER_VARS['USER_UTM'] = req_url
7964
7964
  if not USER_HID: USER_HID = hashlib.blake2b(f"{tid}-{chat_id}".encode('utf-8'), digest_size=4).hexdigest()
7965
+ # USER_HID = hashlib.blake2b(f"{tid}-{chat_id}".encode('utf-8'), digest_size=4).hexdigest()
7965
7966
 
7966
7967
  print(f"out {USER_VARS=}")
7967
7968
  USER_LSTS["USER_DAU"] = list(set(USER_LSTS.get("USER_DAU", []) + [now_.strftime('%Y-%m-%d')]))
@@ -8365,9 +8366,6 @@ async def pay_handler_for_all(bot, message, ideas_en, ideas_ru, PROJECT_USERNAME
8365
8366
  sql = "SELECT USER_TID, USER_VARS, USER_LSTS FROM \"USER\" WHERE USER_TID=$1"
8366
8367
  data_usr = await db_select_pg(sql, (chat_id,), BASE_P)
8367
8368
  if not len(data_usr):
8368
- dt_ = datetime.now(timezone.utc).strftime('%d-%m-%Y_%H-%M-%S')
8369
- sql = "INSERT INTO \"USER\" (USER_TID) VALUES ($1) ON CONFLICT DO NOTHING"
8370
- await db_change_pg(sql, (chat_id,), BASE_P)
8371
8369
  USER_LSTS = json.loads(USER_LSTS_)
8372
8370
  USER_VARS = json.loads(USER_VARS_)
8373
8371
  if payload == 'gift': USER_VARS['USER_UTM'] = 'gift'
@@ -8438,8 +8436,14 @@ async def pay_handler_for_all(bot, message, ideas_en, ideas_ru, PROJECT_USERNAME
8438
8436
  USER_LSTS = json.dumps(USER_LSTS, ensure_ascii=False)
8439
8437
  USER_VARS = json.dumps(USER_VARS, ensure_ascii=False)
8440
8438
 
8441
- sql = f"UPDATE \"USER\" SET USER_VARS=$1, USER_LSTS=$2 WHERE USER_TID=$3"
8442
- await db_change_pg(sql, (USER_VARS, USER_LSTS, chat_id,), BASE_P)
8439
+ sql = """
8440
+ INSERT INTO "USER" (USER_TID, USER_VARS, USER_LSTS)
8441
+ VALUES ($1, $2, $3)
8442
+ ON CONFLICT (USER_TID) DO UPDATE
8443
+ SET USER_VARS = EXCLUDED.USER_VARS,
8444
+ USER_LSTS = EXCLUDED.USER_LSTS
8445
+ """
8446
+ await db_change_pg(sql, (chat_id, USER_VARS, USER_LSTS,), BASE_P)
8443
8447
 
8444
8448
  # , {payload_txt}
8445
8449
  text = f"{l_payment_success[lz]} ★{total_amount}\n\n♥️ @{PROJECT_USERNAME} {l_payment_hashtag[lz]}"
@@ -13764,6 +13768,7 @@ async def bots_by_inline(chat_id, message, BASE_P):
13764
13768
  async def get_buttons_main(lz, bot_un, BASE_P):
13765
13769
  result = []
13766
13770
  try:
13771
+ # url_usr = f"tg://user?id={my_tid}" if random.choice([True, False]) else 'https://t.me/ferey_support?text=hi'
13767
13772
  url_usr = f"tg://user?id={my_tid}" if random.choice([True, False]) else 'https://t.me/ferey_support?text=hi'
13768
13773
  # url_share = f"https://t.me/FereySupportBot?profile"
13769
13774
  if random.choice([True, False]):
@@ -14264,8 +14269,8 @@ async def lz_code_pg(chat_id, lan, BASE_P):
14264
14269
  elif lan in ['ru', 'kz', 'kg', 'uz', 'tm', 'md', 'am', 'uk-UA', 'uk', 'kk', 'tk', 'ky']:
14265
14270
  result = 'ru'
14266
14271
 
14267
- sql = "UPDATE \"USER\" SET USER_LZ=$1 WHERE USER_TID=$2"
14268
- await db_change_pg(sql, (result, chat_id,), BASE_P)
14272
+ # sql = "UPDATE \"USER\" SET USER_LZ=$1 WHERE USER_TID=$2"
14273
+ # await db_change_pg(sql, (result, chat_id,), BASE_P)
14269
14274
  else:
14270
14275
  result = data[0][0]
14271
14276
  except Exception as e:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: yeref
3
- Version: 0.29.58
3
+ Version: 0.29.60
4
4
  Summary: desc-f
5
5
  Author: john smith
6
6
  Dynamic: author
@@ -0,0 +1,8 @@
1
+ yeref/__init__.py,sha256=Qpv3o6Xa78VdLcsSRmctGtpnYE9btpAkCekgGhgJyXM,49
2
+ yeref/l_.py,sha256=N72kYwTRrrbvPlatVurBJCoD70q-Gx4Fnol45qkC7NY,659938
3
+ yeref/tonweb.js,sha256=Jf6aFOQ1OIY4q7fINYz-m5LsI3seMus124M5SYYZmtE,443659
4
+ yeref/yeref.py,sha256=DbW7lJ3LCAjkxRLyK8UM6Fj05IaRPhXKoJrv7C9iQvQ,1048251
5
+ yeref-0.29.60.dist-info/METADATA,sha256=QLjnODKiCHsL780N5Ij3NooTHM3RVNZBux_wvlnFhnk,119
6
+ yeref-0.29.60.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
7
+ yeref-0.29.60.dist-info/top_level.txt,sha256=yCQKchWHbfV-3OuQPYRdi2loypD-nmbDJbtt3OuKKkY,6
8
+ yeref-0.29.60.dist-info/RECORD,,
@@ -1,8 +0,0 @@
1
- yeref/__init__.py,sha256=Qpv3o6Xa78VdLcsSRmctGtpnYE9btpAkCekgGhgJyXM,49
2
- yeref/l_.py,sha256=N72kYwTRrrbvPlatVurBJCoD70q-Gx4Fnol45qkC7NY,659938
3
- yeref/tonweb.js,sha256=Jf6aFOQ1OIY4q7fINYz-m5LsI3seMus124M5SYYZmtE,443659
4
- yeref/yeref.py,sha256=SANQVWu5pea-RxpPfOQaH4dc2HoDmt6EXLjvbKGzyi4,1048065
5
- yeref-0.29.58.dist-info/METADATA,sha256=rYM8N8Zv2pi0G970qcmOj2HrHpEV7Zh0En4eRKOKJGY,119
6
- yeref-0.29.58.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
7
- yeref-0.29.58.dist-info/top_level.txt,sha256=yCQKchWHbfV-3OuQPYRdi2loypD-nmbDJbtt3OuKKkY,6
8
- yeref-0.29.58.dist-info/RECORD,,