AIOgram
0
Вклад в тег
from aiogram import types
from settings import dp, bot
from messages import list_mes
from logs import init_logger
import random
logger = init_logger(__name__)
@dp.business_message()
async def handler_message(message: types.Message):
print(message.business_connection_id)
try:
await bot.send_message(business_connection_id=message.business_connection_id,
chat_id=message.from_user.id, text=random.choice(list_mes))
except Exception as e:
logger.error(f'Не удалось ответить на сообщение в ЛС\n Ошибка - {e}')
async def main() -> None:
await dp.start_polling(bot)