Skip to main content

Asynchronous api of the Flyer service

Project description

<h1>FlyerAPI<img src="https://telegra.ph/file/e2a2f0526d2937973a70b.png" width=50 height=50></h1>

<p align="left" >

    <a href="https://pypi.org/project/flyerapi/">

        <img src="https://img.shields.io/pypi/v/flyerapi?style=flat-square" alt="PyPI">

    </a>

    <a href="https://pypi.org/project/flyerapi/">

        <img src="https://img.shields.io/pypi/dm/flyerapi?style=flat-square" alt="PyPI">

    </a>

</p>

Использование

С помощью flyerapi вы можете использовать FlyerAPI вместе с Telegram

Документация: https://api.flyerservice.io/redoc

Установка

pip install flyerapi

Требования

  • Python 3.7+

  • aiohttp

Возможности

  • Asynchronous

  • Exception handling

Пример обязательной подписки с использованием aiogram

from flyerapi import Flyer



from aiogram import types





flyer = Flyer(KEY)



async def message_handler(message: types.Message):

    # Применяйте везде, где требуется проверка

    if not await flyer.check(message.from_user.id, language_code=message.from_user.language_code):

        return



async def callback_handler(call: types.CallbackQuery):

    # Применяйте везде, где требуется проверка

    if not await flyer.check(call.from_user.id, language_code=call.from_user.language_code):

        return

Использование пользовательского сообщения

message = {

    'text': '<b>Пользовательский текст</b> для $name',  # HTML



    'button_bot': 'Запустить',

    'button_channel': 'Подписаться',

    'button_url': 'Перейти',

    'button_boost': 'Голосовать',

    'button_fp': 'Выполнить',

}

await flyer.check(user_id, language_code=language_code, message=message)

Пример для заданий

# Получение заданий для пользователя

tasks = await flyer.get_tasks(user_id=user_id, language_code=language_code, limit=5)



# Получиение статуса задания

signature = tasks[0]['signature']  # пример

status = await flyer.check_task(user_id=user_id, signature=signature)

Пример для использования заданий в обязательной подписки с использованием aiogram

Код вынесен в файл: examples/check_with_tasks.py

Developed by Eli (c) 2023-2025

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flyerapi-1.2.3.tar.gz (5.3 kB view details)

Uploaded Source

File details

Details for the file flyerapi-1.2.3.tar.gz.

File metadata

  • Download URL: flyerapi-1.2.3.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.3

File hashes

Hashes for flyerapi-1.2.3.tar.gz
Algorithm Hash digest
SHA256 38a6cc2103373a475986942e6d7217d50ddfcc7ed23c4ecbb2c32796d2444f9c
MD5 81fde292cceccc9c55ad1277bdd8ce04
BLAKE2b-256 01c963914a32762d9eef73427b1b957288a1dee042936c1d79ad22a667a36576

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page