Asynchronous api of the Flyer service
Project description
Использование
С помощью flyerapi вы можете использовать FlyerAPI вместе с Telegram
Документация: https://api.flyerservice.io/redoc
Установка
pip install flyerapi
Требования
Python 3.7+aiohttp
Возможности
AsynchronousException 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
Release history Release notifications | RSS feed
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)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d8282243f1e5d621e4ba6bd32c341dbbecd1b3466c8c5490af45507383980d5
|
|
| MD5 |
175cc5cab9d0f27ff6e9727ec3319138
|
|
| BLAKE2b-256 |
ff3b94f55a1de263cad252668d1d1f035f51072c552a70d334374efd6621bf82
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f7fda9840021c33ca8304d6147d1b0079881727e6d0bfea4708fbda801965205
|
|
| MD5 |
101a956efa013297f3ca062dc67d9b6d
|
|
| BLAKE2b-256 |
a982b595b1eaeea4c4a44c3463f2cd8db39ea70a6424f85033ca94f8280e478d
|