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