txlyre 1 day ago
parent
commit
4a062dff47
1 changed files with 4 additions and 3 deletions
  1. 4 3
      openkriemy.py

+ 4 - 3
openkriemy.py

@@ -1,4 +1,3 @@
-import time
 from random import random, randint
 from random import random, randint
 from asyncio import sleep
 from asyncio import sleep
 from datetime import datetime, timedelta, date, time
 from datetime import datetime, timedelta, date, time
@@ -7,6 +6,8 @@ from telethon import TelegramClient
 from telethon.events import NewMessage, InlineQuery
 from telethon.events import NewMessage, InlineQuery
 from telethon.utils import resolve_bot_file_id, get_peer_id
 from telethon.utils import resolve_bot_file_id, get_peer_id
 
 
+from tortoise.exceptions import ConfigurationError
+
 from actions import get_all_birthdays
 from actions import get_all_birthdays
 from utils import parse_command, get_link_to_user, calculate_age, Kind
 from utils import parse_command, get_link_to_user, calculate_age, Kind
 from config import config
 from config import config
@@ -108,7 +109,7 @@ async def on_message(event):
 
 
     try:
     try:
         action = await find_action(command.name)
         action = await find_action(command.name)
-    except SyntaxError:
+    except SyntaxError, ConfigurationError:
         pass
         pass
 
 
     if not await is_allowed(peer_id):
     if not await is_allowed(peer_id):
@@ -194,7 +195,7 @@ async def notify_birthdays():
                     birthday.peer_id,
                     birthday.peer_id,
                     f"{get_link_to_user(entity)}, поздравляю с днём рождения!!~~",
                     f"{get_link_to_user(entity)}, поздравляю с днём рождения!!~~",
                 )
                 )
-            except:
+            except Exception:
                 pass
                 pass