xn-auth 0.2.49__py3-none-any.whl → 0.2.50__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.
x_auth/controller.py CHANGED
@@ -2,7 +2,7 @@ from base64 import b64encode
2
2
  from datetime import timedelta
3
3
 
4
4
  from aiogram import Bot
5
- from aiogram.exceptions import TelegramForbiddenError
5
+ from aiogram.exceptions import TelegramForbiddenError, TelegramBadRequest
6
6
  from aiogram.utils.auth_widget import check_signature
7
7
  from aiogram.utils.web_app import WebAppInitData, safe_parse_webapp_init_data, WebAppUser
8
8
  from litestar import Response, post
@@ -44,7 +44,7 @@ class Auth:
44
44
  try:
45
45
  await Bot(sec).send_chat_action(user.id, "typing")
46
46
  db_user.blocked = False
47
- except TelegramForbiddenError:
47
+ except (TelegramForbiddenError, TelegramBadRequest):
48
48
  db_user.blocked = True
49
49
  else:
50
50
  db_user.blocked = not user.allows_write_to_pm
x_auth/enums.py CHANGED
@@ -13,6 +13,7 @@ class PeerType(IntEnum):
13
13
  supergroup = 4
14
14
  user = 5
15
15
  forum = 6
16
+ direct = 7
16
17
 
17
18
 
18
19
  class RoleScope(IntEnum):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xn-auth
3
- Version: 0.2.49
3
+ Version: 0.2.50
4
4
  Summary: Auth adapter for XN-Api framework
5
5
  Author-email: Artemiev <mixartemev@gmail.com>
6
6
  License: MIT
@@ -0,0 +1,10 @@
1
+ x_auth/controller.py,sha256=IDyamZ-_tPxVb03lIn5ofYYyKeMc5klBru4x9mDKWcw,3773
2
+ x_auth/enums.py,sha256=pciVrb92S9YQFMhHe6pKNYwcvtevwfMXIiG1WxAEa-Q,761
3
+ x_auth/exceptions.py,sha256=2B4okJxhPyNqTJXlSTfblJUQJ60bLGXdgJIu6ue7S6w,162
4
+ x_auth/middleware.py,sha256=JfssQomDv0J_69GfS2a_2_uyRzs26zSY6IW1Vk7m8K0,2900
5
+ x_auth/models.py,sha256=MVd-iFG3CX6-5EVIedd8KBb3fNW_FuwHvKs7_SCwHl8,9312
6
+ x_auth/types.py,sha256=xVi1A8CrGfdfS2HbaxX-X3lEJWH_1TvTk-u8TeqKzQg,1514
7
+ xn_auth-0.2.50.dist-info/METADATA,sha256=iKIOk2FEcH_syE3jkIf5V8FZlUNbVkED6D6uABR4RMs,823
8
+ xn_auth-0.2.50.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
9
+ xn_auth-0.2.50.dist-info/top_level.txt,sha256=ydMDkzxgQPtW-E_MNDfUAroAFZvWSqU-x_kZSA7NSFo,7
10
+ xn_auth-0.2.50.dist-info/RECORD,,
@@ -1,10 +0,0 @@
1
- x_auth/controller.py,sha256=2UUS-v5DcKmXplVeAfoxgfDB9fP8E47HnU49egK-9rc,3731
2
- x_auth/enums.py,sha256=Z4-pJVWNNrjl2_RZqo2ZwuQR5WR46-A76VWmd7k7-4E,746
3
- x_auth/exceptions.py,sha256=2B4okJxhPyNqTJXlSTfblJUQJ60bLGXdgJIu6ue7S6w,162
4
- x_auth/middleware.py,sha256=JfssQomDv0J_69GfS2a_2_uyRzs26zSY6IW1Vk7m8K0,2900
5
- x_auth/models.py,sha256=MVd-iFG3CX6-5EVIedd8KBb3fNW_FuwHvKs7_SCwHl8,9312
6
- x_auth/types.py,sha256=xVi1A8CrGfdfS2HbaxX-X3lEJWH_1TvTk-u8TeqKzQg,1514
7
- xn_auth-0.2.49.dist-info/METADATA,sha256=DLHIFbcunfFTkvj6yHfVWteElYFQ7-VHGC8BXh0lnSc,823
8
- xn_auth-0.2.49.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
9
- xn_auth-0.2.49.dist-info/top_level.txt,sha256=ydMDkzxgQPtW-E_MNDfUAroAFZvWSqU-x_kZSA7NSFo,7
10
- xn_auth-0.2.49.dist-info/RECORD,,