Asynchronous api of the Flyer service
Project description
Usage
With flyerapi
you can use FlyerAPI together with Telegram
Documentation: https://api.flyerservice.io/redoc
Installation
pip install flyerapi
Requirements
Python 3.7+
aiohttp
Features
Asynchronous
Exception handling
Basic example for a mandatory subscription with aiogram
from flyerapi import Flyer
from aiogram import types
flyer = Flyer(KEY)
async def message_handler(message: types.Message):
# Use it wherever verification is necessary
if not await flyer.check(message.from_user.id, language_code=message.from_user.language_code):
return
async def callback_handler(call: types.CallbackQuery):
# Use it wherever verification is necessary
if not await flyer.check(call.from_user.id, language_code=call.from_user.language_code):
return
Using custom message
message = {
'text': '<b>Custom text</b> for $name', # HTML
'button_bot': 'Start',
'button_channel': 'Subscribe',
'button_url': 'Follow',
}
await flyer.check(user_id, language_code=language_code, message=message)
Example for tasks
# Getting tasks for the user
tasks = await flyer.get_tasks(
user_id=user_id,
language_code=language_code, # used only for new pinning
limit=5, # used only for new pinning
)
...
# Checking for completed task
status = await flyer.check_task(
user_id=user_id,
signature=tasks[0]['signature'],
)
Developed by Eli (c) 2023-2024
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.0.tar.gz
(4.9 kB
view details)
File details
Details for the file flyerapi-1.2.0.tar.gz
.
File metadata
- Download URL: flyerapi-1.2.0.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5f4545db6b269f6bd97d0612dc2d5a22b99e38d966d031558cab94b329c11ac |
|
MD5 | 791daa23ca8b8e4ec9d50d3884d1b92c |
|
BLAKE2b-256 | a61fdeaa794b0db915835dc1ad41af8d8c86d10fa7031b1c856b6eebfec93f14 |