feedback/app/actions.py

35 lines
1.4 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Импорт сторонних модулей
from aiogram import F
from aiogram.types import CallbackQuery, FSInputFile
from aiogram.types import InputMediaPhoto
# Импорт модулей приложения
from . import dp
IMAGE = './assets/actions.jpg'
END_MSG = 'Попробуй выполнить команду `/start` ещё раз, чтобы посмотреть на другой результат 😉\n\n🎲 Они выпадают случайным образом\\!'
@dp.callback_query(F.data == 'action_gift')
async def action_gift(callback: CallbackQuery) -> None:
msg = 'Спасибо за подарок 🤭\n\n' 'Но я принимаю только ' '⛽ нефть ' '🥃 алкоголь ' 'и 🍫 шоколадки\n' '\n'
msg += END_MSG
await callback.message.edit_media(InputMediaPhoto(media=FSInputFile(path='./assets/gift.jpg'), caption=msg))
@dp.callback_query(F.data == 'action_poo')
async def action_poo(callback: CallbackQuery) -> None:
msg = 'Я увернулся 🫣\n\n'
msg += END_MSG
await callback.message.edit_media(InputMediaPhoto(media=FSInputFile(path='./assets/poo.jpg'), caption=msg))
@dp.callback_query(F.data == 'action_caress')
async def action_caress(callback: CallbackQuery) -> None:
msg = '🤤\n\n'
msg += END_MSG
await callback.message.edit_media(InputMediaPhoto(media=FSInputFile(path='./assets/caress.jpg'), caption=msg))