yeref 0.29.17__tar.gz → 0.29.19__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: yeref
3
- Version: 0.29.17
3
+ Version: 0.29.19
4
4
  Summary: desc-f
5
5
  Author: john smith
6
6
  Dynamic: author
@@ -2,7 +2,7 @@ from setuptools import setup
2
2
 
3
3
  setup(
4
4
  name='yeref',
5
- version='0.29.17',
5
+ version='0.29.19',
6
6
  description='desc-f',
7
7
  author='john smith',
8
8
  packages=['yeref'],
@@ -13732,6 +13732,63 @@ async def edit_simple2(bot, chat_id, user_id, entity_id, post_id, message_id, cu
13732
13732
 
13733
13733
 
13734
13734
  # region fun
13735
+ async def is_reason(user_id, user_username, user_full_name, ENT_CBAN):
13736
+ result = None
13737
+ try:
13738
+ new_, nousername_, cas_, symbols_, zalgo_ = list(ENT_CBAN)
13739
+
13740
+ if nousername_ == '☑' and not user_username:
13741
+ result = 'no @username'
13742
+ return
13743
+ if new_ == '☑' and user_id > old_tid:
13744
+ result = 'new id'
13745
+ return
13746
+ if cas_ == '☑':
13747
+ headers = {
13748
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 "
13749
+ "(KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36",
13750
+ "Accept": "application/json",
13751
+ "Accept-Language": "en;q=0.9",
13752
+ "Referer": "https://cas.chat/",
13753
+ }
13754
+ async with httpx.AsyncClient(http2=True, headers=headers, timeout=10) as client:
13755
+ url = f"https://api.cas.chat/check?user_id={user_id}"
13756
+ resp = await client.get(url)
13757
+
13758
+ print(f"? JSON: {url}")
13759
+ if resp.status_code == 200 and resp.headers.get("Content-Type", "").startswith("application/json"):
13760
+ data = resp.json()
13761
+
13762
+ print(f"? JSON: {data}")
13763
+ if data.get("ok") is True:
13764
+ print(f"✅ JSON: {data}")
13765
+ result = f"cas: {url}"
13766
+ return
13767
+ if zalgo_ == '☑':
13768
+ # '͞'
13769
+ # arr_zalgo = list(map(chr, range(768, 879)))
13770
+ # if len([item for item in arr_zalgo if item in user_full_name]):
13771
+ if has_zalgo(user_full_name):
13772
+ result = f"zalgo symbols: {user_full_name}"
13773
+ return
13774
+ if symbols_ == '☑':
13775
+ # ؀ , 世 文 , ችግሩ (ethiop)
13776
+ # arr_arab_hier = list(map(chr, range(1536, 1791))) + list(map(chr, range(19968, 40959))) + list(
13777
+ # map(chr, range(4608, 4991)))
13778
+ # ؀ , 世 文 , ችግሩ (эфиопский)
13779
+ if has_non_european_glyph(user_full_name):
13780
+ result = f"arab/zh symbols: {user_full_name}"
13781
+ return
13782
+ except TelegramRetryAfter as e:
13783
+ logger.info(log_ % f"TelegramRetryAfter {e.retry_after}")
13784
+ await asyncio.sleep(e.retry_after + 1)
13785
+ except Exception as e:
13786
+ logger.info(log_ % str(e))
13787
+ await asyncio.sleep(round(random.uniform(0, 1), 2))
13788
+ finally:
13789
+ return result
13790
+
13791
+
13735
13792
  def has_non_european_glyph(text):
13736
13793
  if text.isascii(): return False
13737
13794
  return bool(PAT.search(text))
@@ -13911,7 +13968,7 @@ async def get_buttons_main(lz, bot_un, BASE_P):
13911
13968
  else:
13912
13969
  url_share = f'https://t.me/share/url?url=https%3A%2F%2Ft.me%2F{bot_un}&text=%40{bot_un}'
13913
13970
  web_app_ = types.WebAppInfo(url='https://telegra.ph/Links-07-05-462') # "ᵗᶢᴿᴬᴾᴴ" "ᶜᵸᴬᴺᴺᴱᴸ"
13914
- text_like = await read_likes(BASE_P) if random.choice([True, False]) else '⁰⁰⁰'
13971
+ text_like = await read_likes(BASE_P) if random.choice([True, True, True, False]) else '⁰⁰⁰'
13915
13972
 
13916
13973
  result = [
13917
13974
  types.InlineKeyboardButton(text="👩🏽‍💼", url=url_usr),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: yeref
3
- Version: 0.29.17
3
+ Version: 0.29.19
4
4
  Summary: desc-f
5
5
  Author: john smith
6
6
  Dynamic: author
File without changes
File without changes
File without changes
File without changes
File without changes