from aiogram.types import ReplyKeyboardMarkup, KeyboardButton, InlineKeyboardMarkup, InlineKeyboardButton
import markup as nav
import logging
from aiogram import Bot, Dispatcher, executor, types
from aiogram.types.message import ContentType
import telebot
from telebot import types
elif message.text == 'Я подтверждаю условия':
bot.send_message(message.chat.id, 'Оплати', reply_markup=nav.lopid)
btnSub = types.KeyboardButton('Оплатить')
lopid = ReplyKeyboardMarkup(resize_keyboard=True)
lopid.add(btnSub)
elif message.text == 'Оплатить':
button1 = types.InlineKeyboardMarkup(resize_keyboard=True)
btm = InlineKeyboardButton(text='Оплатить 900р', callback_date="pay")
button1.add(btm)
@bot.callback_query_handler(text="pay", func=lambda c: True)
async def pay(call: types.CallbackQuery):
await bot.delete_message(call.from_user.id, call.message.id)
await bot.send_invoice(chat_id=call.from_user.id,
title='RRRRR',
description='eke',
payload = 'mmonth_sub',
provider_token='TOKEN',
currency='RUB',
start_parameter='test_bot',
prices=[{'label': 'Руб', 'amount': 90000}])
@bot.pre_checkout_query_handler(func=lambda c: True)
async def process_pre_checkout_query(pre_checkout_query: types.PreCheckoutQuery):
await bot.answer_pre_checkout_query(pre_checkout_query.id, ok=True)
@bot.message_handler(content_types=ContentType.SUCCESSFUL_PAYMENT)
async def process_pay(message: types.Message):
if message.successful_payment.invoice_payload == "mmonth_su":
await bot.send_message(message.chat.id, 'weeee')
if __name__ == "__main__":
executor.start_polling(bot, skip_updates=True)
bot.polling(none_stop=True)