Загрузка...

Bot on aiogram: paid subscription

Thread in Python created by K1p1k Jan 5, 2023. (bumped Dec 21, 2024) 402 views

  1. K1p1k
    K1p1k Topic starter Jan 5, 2023 23 Jul 1, 2022
    ПРОШУ НАПИСАЛ НЕ ПРОВЕРЯЛ ОПЛАТУ ЕСЛИ БУДЕТ ОШИБКА ТО ИСПРАВИТЕ ПЖ
    ПЕРВЫЙ ОПЫТ С pyqiwip2p
    Бот очень сырой
    Оплата :****:
    Как настроить
    Подписка навсегда
    Заходим в config
    token=<токен бота>
    chat_id=<id чата или канала можно узнав добавив бота в группу и написав /get_id>

    QiwiP2P_ApiKey=<ключ с сайта(приватный) >
    price=<Стоимость подписки>
    Python
    from aiogram import Bot, Dispatcher, executor, types
    from aiogram.contrib.fsm_storage.memory import MemoryStorage
    from aiogram.dispatcher.filters import BoundFilter
    from pyqiwip2p import QiwiP2P
    import config


    storage=MemoryStorage()
    bot=Bot(token=config.token)
    dp=Dispatcher(bot=bot, storage=storage)
    p2p=QiwiP2P(auth_key=config.QiwiP2P_ApiKey)

    class IsCheckBuy(BoundFilter):
    async def check(self, message: types.Message):
    status_user=await bot.get_chat_member(chat_id=config.chat_id, user_id=message.from_user.id)
    if status_user['status'] == 'left':
    return True

    else:
    await bot.send_message(chat_id=message.chat.id, text='Вы уже купили чит')
    return False


    @dp.message_handler(IsCheckBuy(), text='/start')
    async def cmd_start(message: types.Message):
    await bot.send_message(chat_id=message.chat.id, text='Купить чит по команде /buy')

    @dp.message_handler(IsCheckBuy(), text='/get_id')
    async def cmd_start(message: types.Message):
    if message.chat.type != 'private':
    await bot.send_message(chat_id=message.chat.id, text=message.chat.id)

    @dp.message_handler(IsCheckBuy(), text='/check')
    async def cmd_start(message: types.Message):
    if message.chat.type == 'private':
    if p2p.check(bill_id=message.from_user.id).status == 'PAID':
    link_status=await bot.create_chat_invite_link(chat_id=config.chat_id, member_limit=1)
    await bot.send_message(chat_id=message.chat.id, text=link_status.invite_link)
    else:
    await bot.send_message(chat_id=message.chat.id, text='Оплата не найдена')

    @dp.message_handler(IsCheckBuy(), text='/buy')
    async def cmd_start(message: types.Message):
    if message.chat.type == 'private':
    p2p.bill(bill_id=message.from_user.id, amount=config.price, lifetime=15, comment=f'TG ID: {message.from_user.id}')
    await bot.send_message(chat_id=message.chat.id, text='Оплати счет ссылка снизу\nЧто-бы проверить счет напишите /check')
    await bot.send_message(chat_id=message.chat.id, text=p2p.check(bill_id=message.from_user.id).pay_url)






    executor.start_polling(dp)
    Python
    token=''
    chat_id=

    QiwiP2P_ApiKey=''
    price=
    aiogram
    pyqiwip2p
     
Top
Loading...