from aiogram import Bot, Dispatcher, executor, types
from aiogram.types import ContentType, InputFile, InlineKeyboardButton, InlineKeyboardMarkup
import config
import inline as nav
import text as bottext
# БОТ
bot = Bot(token=config.Token)
dp = Dispatcher(bot)
@dp.message_handler(commands=['start'])
async def start(message: types.Message):
photo = InputFile("media/main.jpg")
text = bottext.maintext
await bot.send_photo(chat_id=message.chat.id, photo=photo, caption=text, reply_markup=nav.mainMenu)
@dp.callback_query_handler(text='faq')
async def faq(callback: types.CallbackQuery):
photo = InputFile("media/faq.jpg")
text = bottext.faqtext
await callback.message.answer_photo(photo=photo, caption=text)
# Запуск бота
if __name__ == "__main__":
executor.start_polling(dp, skip_updates=False)
Файл inline.py
from aiogram.types import ContentType, InputFile, InlineKeyboardButton, InlineKeyboardMarkup
# Кнопки главного меню
mainMenu = InlineKeyboardMarkup(row_width=2)
Shop = InlineKeyboardButton(text='Магазин ', callback_data='shop')
FAQ = InlineKeyboardButton(text='FAQ ⁉️', callback_data='faq')
Helper = InlineKeyboardButton(text='Поддержка ', url='t.me/FastShopHelp_bot')
Otzivi = InlineKeyboardButton(text='Отзывы ️', url='t.me/FastShop_Checks')
Kabinet = InlineKeyboardButton(text='Кабинет ️', callback_data='kabinet')
mainMenu.add(Shop, FAQ, Helper, Otzivi, Kabinet)
# Кнопки FAQ
faqMenu = InlineKeyboardMarkup(row_width=2)
gomain = InlineKeyboardButton(text='Главное меню', callback_data='start')
faqMenu.insert(gomain)