from aiogram import Bot, types
from aiogram.dispatcher import Dispatcher
from aiogram.utils import executor
from aiogram.types import InlineKeyboardMarkup, InlineKeyboardButton, ReplyKeyboardMarkup
from aiogram.types import InputMediaPhoto, InputFile
bot = Bot(token = 'токен')
dp = Dispatcher(bot)
ikb = InlineKeyboardMarkup()
ib1 = InlineKeyboardButton(text='Купить футболки', callback_data='kup')
ib2 = InlineKeyboardButton(text='Профиль', callback_data='pro')
ikb.add(ib1).add(ib2)
@dp.message_handler(commands=['start'])
async def send_photo(message: types.Message):
await bot.send_photo(chat_id=message.chat.id,photo=open('C:/SilverGold/444e428541b0415c1c30438cf5a5781e.jpg', 'rb'),caption=f'*Здравствуй,{message.from_user.first_name}, в этом боте ты сможешь купить футболки за выгодную цену!*',parse_mode='Markdown', reply_markup=ikb)
ia1 = InlineKeyboardButton(text='1000 футболок', callback_data='sos1',)
ia2 = InlineKeyboardButton(text='2800 футболок', callback_data='sos2',)
ia3 = InlineKeyboardButton(text='5000 футболок', callback_data='sos3',)
ia4 = InlineKeyboardButton(text='13500 футболок', callback_data='sos4',)
ia5 = InlineKeyboardButton(text='Назад', callback_data='naz')
keyboard_inline = InlineKeyboardMarkup().add(ia1, ia2).add(ia3, ia4).add(ia5)
@dp.callback_query_handler()
async def callback_query(call: types.CallbackQuery):
if call.data == 'kup':
photo = types.InputFile('C:/SilverGold/05a27d2d-04ea-4d45-a2f0-1a9f29286015.jfif')
await bot.edit_message_reply_markup(call.message.chat.id, call.message.message_id, reply_markup=keyboard_inline)
await bot.edit_message_media(types.InputMediaPhoto(photo, caption='Текст со второй фотографией'),call.message.chat.id, call.message.message_id)
elif call.data == 'naz':
await bot.delete_message(call.message.chat.id, call.message.message_id)
executor.start_polling(dp, skip_updates=True)