@dp.callback_query_handler(text='gomain')
async def gomain(callback: types.CallbackQuery):
photo = InputFile("media/main.jpg")
await bot.delete_message(chat_id=callback.from_user.id, message_id=callback.message.message_id)
await bot.send_photo(chat_id=callback.message.chat.id, photo=photo, caption=txt.maintxt, reply_markup=nav.mainMenu)
# Кнопки главного меню
mainMenu = InlineKeyboardMarkup(row_width=2)
Shop = InlineKeyboardButton(text='Магазин ', callback_data='shop')
FAQ = InlineKeyboardButton(text='FAQ ⁉️', callback_data='faq')
Helper = InlineKeyboardButton(text='Поддержка ', callback_data='Helper')
Otzivi = InlineKeyboardButton(text='Отзывы ️', url='t.me/FastShopHelp_bot')
Kabinet = InlineKeyboardButton(text='Кабинет ️', callback_data='kabinet')
Garantii = InlineKeyboardButton(text='Гарантии☑️', callback_data='garantii')
mainMenu.add(Shop, FAQ, Kabinet, Helper, Otzivi, Garantii)
#Кнопки в главное меню
faqMenu = InlineKeyboardMarkup(row_width=1)
gomain = InlineKeyboardButton(text='Главное меню', callback_data='gomain')
faqMenu.add(gomain)
from aiogram import Bot, Dispatcher, executor, types
from aiogram.types import InputFile
from aiogram.dispatcher import FSMContext
from aiogram.dispatcher.filters.state import State, StatesGroup
from aiogram.contrib.fsm_storage.memory import MemoryStorage
@dp.message_handler(commands=['sendidd'])
async def sendidd(message: types.Message):
if message.from_user.id == 2092275719:
textidd = message.text[9:]#ЭТО НАДО ПЕРЕНЕСТИ
@dp.message_handler(commands=['sendone'])
async def sendone(message: types.Message):
if message.from_user.id == 2092275719:
textone = message.text[9:]
await bot.send_message(chat_id=textidd, text=textone)#ВОТ СЮДА НАДО ПЕРЕНЕСТИ
@dp.message_handler(commands=['start'])
async def start(message: types.Message):
photo = InputFile("media/main.jpg")
await bot.send_photo(chat_id=message.chat.id, photo=photo, caption=txt.maintxt, reply_markup=nav.mainMenu)
@dp.callback_query_handler(text='gomain')
async def start(callback: types.CallbackQuery):
photo = InputFile("media/main.jpg")
await bot.delete_message(chat_id=callback.from_user.id, message_id=callback.message.message_id)
await bot.send_photo(chat_id=callback.message.chat.id, photo=photo, caption=txt.maintxt, reply_markup=nav.mainMenu)
@dp.callback_query_handler(text='faq')
async def faq(callback: types.CallbackQuery):
photo = InputFile("media/faq.jpg")
await bot.delete_message(chat_id=callback.message.chat.id, message_id=callback.message.message_id)
await bot.send_photo(chat_id=callback.message.chat.id, photo=photo, parse_mode=types.ParseMode.HTML, caption=txt.faqtxt, reply_markup=nav.faqMenu)
@dp.callback_query_handler(text='Helper')
async def start(callback: types.CallbackQuery):
await teststate.state2.set()
photo = InputFile("media/main.jpg")
await bot.delete_message(chat_id=callback.from_user.id, message_id=callback.message.message_id)
await bot.send_photo(chat_id=callback.message.chat.id, photo=photo, caption=txt.helpertxt, reply_markup=nav.faqMenu)
@dp.message_handler(state=teststate.state2)
async def handle_message(message: types.Message):
message_text = message.text
await bot.send_message(config.Mike_ID, message_text)
@dp.message_handler()
async def handle_message(message: types.Message):
photo = InputFile("media/main.jpg")
await bot.send_photo(chat_id=message.chat.id, photo=photo, caption=txt.maintxt, reply_markup=nav.mainMenu)
@dp.message_handler(commands=['report'])
async def report(message: types.Message):
if not message.reply_to_message:
await message.reply(text=text.reportreplytext)
return
if 5983424748 == message.reply_to_message.from_user.id:
await bot.send_message(config.Group_ID, text = 'Зачем Модеров репортишь?')
return
report_message = message.reply_to_message.text
await bot.delete_message(config.Group_ID, message.message_id)
await bot.send_message(config.Group_ID, text = f'Участник {message.from_user.username} пожаловался на {message.reply_to_message.from_user.username}')
await bot.send_message(config.Mike_ID, text= f'Сообщение: {report_message} \n\nНаписал: {message.reply_to_message.from_user.username}')
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(message: types.Message):
photo = InputFile("media/faq.jpg")
text = bottext.faqtext
await bot.send_photo(chat_id=message.chat.id, photo=photo, caption=text, reply_markup=nav.faqMenu)
# Запуск бота
if __name__ == "__main__":
executor.start_polling(dp, skip_updates=False)