Skip to main content

Asynchronous api of the Flyer service

Project description

FlyerAPI

PyPI PyPI

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

С помощью 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 = {
    'rows': 2,
    'text': '<b>Пользовательский текст</b> для $name',  # HTML

    'button_bot': 'Запустить',
    'button_channel': 'Подписаться',
    'button_url': 'Перейти',
    'button_boost': 'Голосовать',
    'button_fp': 'Выполнить',
    'button_view': 'Смотреть',
}
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(signature)

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

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

Пример вебхуков

Код вынесен в файл: examples/webhook.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.3.3.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flyerapi-1.3.3-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: flyerapi-1.3.3.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for flyerapi-1.3.3.tar.gz
Algorithm Hash digest
SHA256 5d8282243f1e5d621e4ba6bd32c341dbbecd1b3466c8c5490af45507383980d5
MD5 175cc5cab9d0f27ff6e9727ec3319138
BLAKE2b-256 ff3b94f55a1de263cad252668d1d1f035f51072c552a70d334374efd6621bf82

See more details on using hashes here.

File details

Details for the file flyerapi-1.3.3-py3-none-any.whl.

File metadata

  • Download URL: flyerapi-1.3.3-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for flyerapi-1.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f7fda9840021c33ca8304d6147d1b0079881727e6d0bfea4708fbda801965205
MD5 101a956efa013297f3ca062dc67d9b6d
BLAKE2b-256 a982b595b1eaeea4c4a44c3463f2cd8db39ea70a6424f85033ca94f8280e478d

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