xn-auth 0.2.49__tar.gz → 0.2.50__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: 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
@@ -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
@@ -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
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes