Catalog PyPI
PACKAGE EXPLORERView in registry

adstelo

PyPI

Adstelo Python SDK — Monetize your Telegram bot with one line of code

Versions collected1
Direct dependencies2From release 0.2.2
Last observed20 Oct, 19:54 UTC

README

Version 0.2.2 documentation

Adstelo Python SDK

Monetize your Telegram bot with a single line of code.

Adstelo lets you earn revenue from ads displayed in your Telegram bot — just add two lines to your existing bot and start earning.

PyPI version Python 3.7+


Table of Contents


  1. You register your bot on Adstelo and get a bot_secret + api_key.
  2. You call adstelo.init(...) once at the top of your bot code.
  3. The SDK records usage metrics to help Adstelo optimize ad delivery.
  4. No message content is ever read or transmitted to Adstelo or any third party. Only high-level usage metrics are sent in the background.

Security: Your Telegram bot token is never transmitted. Only an opaque bot_secret is sent. All requests are HMAC-signed with your API key.


Installation

pip install adstelo

Requires Python 3.7+. The only dependency is aiohttp.


Quick Start

import adstelo

adstelo.init(
    bot_secret="your-bot-secret",   # From your Adstelo dashboard
    api_key="your-api-key",         # From your Adstelo dashboard
)

# ... rest of your bot code, completely unchanged

That's it. The SDK auto-detects whichever Telegram library you have installed and patches it transparently.


Supported Libraries

aiogram v3

import adstelo
from aiogram import Bot, Dispatcher

# ✅ Initialize Adstelo BEFORE creating the Dispatcher
adstelo.init(
    bot_secret="your-bot-secret",
    api_key="your-api-key",
)

bot = Bot(token="YOUR_BOT_TOKEN")
dp = Dispatcher()

@dp.message()
async def handle_message(message):
    await message.answer("Hello!")

# Run your bot as usual
import asyncio
asyncio.run(dp.start_polling(bot))

python-telegram-bot v20+

import adstelo
from telegram.ext import Application, MessageHandler, filters

# ✅ Initialize Adstelo BEFORE building the Application
adstelo.init(
    bot_secret="your-bot-secret",
    api_key="your-api-key",
)

async def handle_message(update, context):
    await update.message.reply_text("Hello!")

app = Application.builder().token("YOUR_BOT_TOKEN").build()
app.add_handler(MessageHandler(filters.TEXT, handle_message))
app.run_polling()

pyTelegramBotAPI (telebot)

Synchronous:

import adstelo
import telebot

# ✅ Initialize Adstelo BEFORE creating the TeleBot instance
adstelo.init(
    bot_secret="your-bot-secret",
    api_key="your-api-key",
)

bot = telebot.TeleBot("YOUR_BOT_TOKEN")

@bot.message_handler(func=lambda m: True)
def handle_message(message):
    bot.send_message(message.chat.id, "Hello!")

bot.infinity_polling()

Async:

import adstelo
from telebot.async_telebot import AsyncTeleBot
import asyncio

adstelo.init(
    bot_secret="your-bot-secret",
    api_key="your-api-key",
)

bot = AsyncTeleBot("YOUR_BOT_TOKEN")

@bot.message_handler(func=lambda m: True)
async def handle_message(message):
    await bot.send_message(message.chat.id, "Hello!")

asyncio.run(bot.polling())

Telethon

import adstelo
from telethon import TelegramClient, events

# ✅ Initialize Adstelo BEFORE creating the TelegramClient
adstelo.init(
    bot_secret="your-bot-secret",
    api_key="your-api-key",
)

client = TelegramClient("my_bot", api_id=12345, api_hash="your_api_hash")
client.start(bot_token="YOUR_BOT_TOKEN")

@client.on(events.NewMessage)
async def handle_message(event):
    await event.reply("Hello!")

client.run_until_disconnected()

Configuration Reference

ParameterTypeRequiredDescription
bot_secretstr✅ YesYour bot's secret from the Adstelo dashboard. Identifies your bot server-side without exposing your Telegram token.
api_keystr✅ YesYour Adstelo API key. Used to authenticate requests and sign payloads.
cooldownint | float❌ NoPer-user event cooldown in seconds. Default: 2. Prevents duplicate events from rapid interactions.

Getting Your Keys

  1. Sign up at adstelo.com and log in to your dashboard
  2. Go to "Register Bot" and submit your bot's Telegram username
  3. Once approved, your dashboard will show:
    • bot_secret — unique to each registered bot
    • api_key — tied to your account (used across all your bots)
  4. Copy both values and pass them to adstelo.init()

Your api_key is like a password — keep it private and never commit it to version control. Use environment variables:

import os, adstelo
adstelo.init(
    bot_secret=os.environ["ADSTELO_BOT_SECRET"],
    api_key=os.environ["ADSTELO_API_KEY"],
)

FAQ

Does this slow down my bot? No. Events are dispatched asynchronously in the background and never block your handlers. The timeout for each request is 3 seconds and errors are silently swallowed.

What if I use a library that isn't listed? The SDK currently supports aiogram v3, python-telegram-bot v20+, pyTelegramBotAPI (sync & async), and Telethon. More libraries are on the roadmap. Open an issue or email support@adstelo.com.

What exactly is tracked? The SDK reports: user ID, chat ID, event type (message, button, photo, video, sticker, inline_query), a timestamp, and whether it was a /start command. No message content is ever read or transmitted.

What is the difference between bot_secret and api_key?

  • bot_secret — identifies which bot generated the event. One per bot.
  • api_key — authenticates your account. One per publisher account.

Do I need to change anything else in my bot? No. Call adstelo.init() once at startup before your Dispatcher/Application/Bot is created, and everything else stays exactly as-is.

When do I get paid? Earnings from ads displayed in your bot accumulate in your Adstelo dashboard. Withdrawals are processed on request. See adstelo.com for payout details.


License

Proprietary — © Adstelo. All rights reserved.

Downloads & popularity

2downloads
1-day window · source-reported counts19 Oct 2026
2512.50
2026-07-22: 2 · observed 2026-10-20T21:25:09.3134068Z · period 2026-07-22–2026-07-222026-07-23: 5 · observed 2026-10-20T21:25:09.3134068Z · period 2026-07-23–2026-07-232026-07-24: 4 · observed 2026-10-20T21:25:09.3134068Z · period 2026-07-24–2026-07-242026-07-27: 2 · observed 2026-10-20T21:25:09.3134068Z · period 2026-07-27–2026-07-272026-07-28: 2 · observed 2026-10-20T21:25:09.3134068Z · period 2026-07-28–2026-07-282026-07-29: 2 · observed 2026-10-20T21:25:09.3134068Z · period 2026-07-29–2026-07-292026-07-30: 2 · observed 2026-10-20T21:25:09.3134068Z · period 2026-07-30–2026-07-302026-07-31: 2 · observed 2026-10-20T21:25:09.3134068Z · period 2026-07-31–2026-07-312026-08-01: 2 · observed 2026-10-20T21:25:09.3134068Z · period 2026-08-01–2026-08-012026-08-02: 3 · observed 2026-10-20T21:25:09.3134068Z · period 2026-08-02–2026-08-022026-08-03: 2 · observed 2026-10-20T21:25:09.3134068Z · period 2026-08-03–2026-08-032026-08-05: 2 · observed 2026-10-20T21:25:09.3134068Z · period 2026-08-05–2026-08-052026-08-06: 3 · observed 2026-10-20T21:25:09.3134068Z · period 2026-08-06–2026-08-062026-08-08: 2 · observed 2026-10-20T21:25:09.3134068Z · period 2026-08-08–2026-08-082026-08-09: 3 · observed 2026-10-20T21:25:09.3134068Z · period 2026-08-09–2026-08-092026-08-10: 2 · observed 2026-10-20T21:25:09.3134068Z · period 2026-08-10–2026-08-102026-08-12: 2 · observed 2026-10-20T21:25:09.3134068Z · period 2026-08-12–2026-08-122026-08-13: 2 · observed 2026-10-20T21:25:09.3134068Z · period 2026-08-13–2026-08-132026-08-14: 6 · observed 2026-10-20T21:25:09.3134068Z · period 2026-08-14–2026-08-142026-08-17: 2 · observed 2026-10-20T21:25:09.3134068Z · period 2026-08-17–2026-08-172026-08-18: 2 · observed 2026-10-20T21:25:09.3134068Z · period 2026-08-18–2026-08-182026-08-20: 3 · observed 2026-10-20T21:25:09.3134068Z · period 2026-08-20–2026-08-202026-08-21: 2 · observed 2026-10-20T21:25:09.3134068Z · period 2026-08-21–2026-08-212026-08-23: 3 · observed 2026-10-20T21:25:09.3134068Z · period 2026-08-23–2026-08-232026-08-24: 7 · observed 2026-10-20T21:25:09.3134068Z · period 2026-08-24–2026-08-242026-08-27: 1 · observed 2026-10-20T21:25:09.3134068Z · period 2026-08-27–2026-08-272026-08-28: 1 · observed 2026-10-20T21:25:09.3134068Z · period 2026-08-28–2026-08-282026-08-29: 2 · observed 2026-10-20T21:25:09.3134068Z · period 2026-08-29–2026-08-292026-08-31: 2 · observed 2026-10-20T21:25:09.3134068Z · period 2026-08-31–2026-08-312026-09-01: 2 · observed 2026-10-20T21:25:09.3134068Z · period 2026-09-01–2026-09-012026-09-07: 3 · observed 2026-10-20T21:25:09.3134068Z · period 2026-09-07–2026-09-072026-09-09: 1 · observed 2026-10-20T21:25:09.3134068Z · period 2026-09-09–2026-09-092026-09-10: 1 · observed 2026-10-20T21:25:09.3134068Z · period 2026-09-10–2026-09-102026-09-12: 1 · observed 2026-10-20T21:25:09.3134068Z · period 2026-09-12–2026-09-122026-09-18: 2 · observed 2026-10-20T21:25:09.3134068Z · period 2026-09-18–2026-09-182026-09-19: 3 · observed 2026-10-20T21:25:09.3134068Z · period 2026-09-19–2026-09-192026-09-26: 2 · observed 2026-10-20T21:25:09.3134068Z · period 2026-09-26–2026-09-262026-09-27: 2 · observed 2026-10-20T21:25:09.3134068Z · period 2026-09-27–2026-09-272026-09-28: 1 · observed 2026-10-20T21:25:09.3134068Z · period 2026-09-28–2026-09-282026-09-29: 2 · observed 2026-10-20T21:25:09.3134068Z · period 2026-09-29–2026-09-292026-09-30: 2 · observed 2026-10-20T21:25:09.3134068Z · period 2026-09-30–2026-09-302026-10-01: 1 · observed 2026-10-20T21:25:09.3134068Z · period 2026-10-01–2026-10-012026-10-02: 3 · observed 2026-10-20T21:25:09.3134068Z · period 2026-10-02–2026-10-022026-10-06: 1 · observed 2026-10-20T21:25:09.3134068Z · period 2026-10-06–2026-10-062026-10-09: 2 · observed 2026-10-20T21:25:09.3134068Z · period 2026-10-09–2026-10-092026-10-10: 1 · observed 2026-10-20T21:25:09.3134068Z · period 2026-10-10–2026-10-102026-10-11: 1 · observed 2026-10-20T21:25:09.3134068Z · period 2026-10-11–2026-10-112026-10-13: 2 · observed 2026-10-20T21:25:09.3134068Z · period 2026-10-13–2026-10-132026-10-15: 1 · observed 2026-10-20T21:25:09.3134068Z · period 2026-10-15–2026-10-152026-10-18: 25 · observed 2026-10-20T21:25:09.3134068Z · period 2026-10-18–2026-10-182026-10-19: 2 · observed 2026-10-20T21:25:09.3134068Z · period 2026-10-19–2026-10-19
22 Jul19 Oct

pypistats · 51 observations shown. Missing days are unknown. Source category: overall: without mirrors.

View observed values
Date / source periodValueObserved at
2026-10-19 – 2026-10-1922026-10-20T21:25:09.3134068Z
2026-10-18 – 2026-10-18252026-10-20T21:25:09.3134068Z
2026-10-15 – 2026-10-1512026-10-20T21:25:09.3134068Z
2026-10-13 – 2026-10-1322026-10-20T21:25:09.3134068Z
2026-10-11 – 2026-10-1112026-10-20T21:25:09.3134068Z
2026-10-10 – 2026-10-1012026-10-20T21:25:09.3134068Z
2026-10-09 – 2026-10-0922026-10-20T21:25:09.3134068Z
2026-10-06 – 2026-10-0612026-10-20T21:25:09.3134068Z
2026-10-02 – 2026-10-0232026-10-20T21:25:09.3134068Z
2026-10-01 – 2026-10-0112026-10-20T21:25:09.3134068Z
2026-09-30 – 2026-09-3022026-10-20T21:25:09.3134068Z
2026-09-29 – 2026-09-2922026-10-20T21:25:09.3134068Z
2026-09-28 – 2026-09-2812026-10-20T21:25:09.3134068Z
2026-09-27 – 2026-09-2722026-10-20T21:25:09.3134068Z
2026-09-26 – 2026-09-2622026-10-20T21:25:09.3134068Z
2026-09-19 – 2026-09-1932026-10-20T21:25:09.3134068Z
2026-09-18 – 2026-09-1822026-10-20T21:25:09.3134068Z
2026-09-12 – 2026-09-1212026-10-20T21:25:09.3134068Z
2026-09-10 – 2026-09-1012026-10-20T21:25:09.3134068Z
2026-09-09 – 2026-09-0912026-10-20T21:25:09.3134068Z
2026-09-07 – 2026-09-0732026-10-20T21:25:09.3134068Z
2026-09-01 – 2026-09-0122026-10-20T21:25:09.3134068Z
2026-08-31 – 2026-08-3122026-10-20T21:25:09.3134068Z
2026-08-29 – 2026-08-2922026-10-20T21:25:09.3134068Z
2026-08-28 – 2026-08-2812026-10-20T21:25:09.3134068Z
2026-08-27 – 2026-08-2712026-10-20T21:25:09.3134068Z
2026-08-24 – 2026-08-2472026-10-20T21:25:09.3134068Z
2026-08-23 – 2026-08-2332026-10-20T21:25:09.3134068Z
2026-08-21 – 2026-08-2122026-10-20T21:25:09.3134068Z
2026-08-20 – 2026-08-2032026-10-20T21:25:09.3134068Z
2026-08-18 – 2026-08-1822026-10-20T21:25:09.3134068Z
2026-08-17 – 2026-08-1722026-10-20T21:25:09.3134068Z
2026-08-14 – 2026-08-1462026-10-20T21:25:09.3134068Z
2026-08-13 – 2026-08-1322026-10-20T21:25:09.3134068Z
2026-08-12 – 2026-08-1222026-10-20T21:25:09.3134068Z
2026-08-10 – 2026-08-1022026-10-20T21:25:09.3134068Z
2026-08-09 – 2026-08-0932026-10-20T21:25:09.3134068Z
2026-08-08 – 2026-08-0822026-10-20T21:25:09.3134068Z
2026-08-06 – 2026-08-0632026-10-20T21:25:09.3134068Z
2026-08-05 – 2026-08-0522026-10-20T21:25:09.3134068Z
2026-08-03 – 2026-08-0322026-10-20T21:25:09.3134068Z
2026-08-02 – 2026-08-0232026-10-20T21:25:09.3134068Z
2026-08-01 – 2026-08-0122026-10-20T21:25:09.3134068Z
2026-07-31 – 2026-07-3122026-10-20T21:25:09.3134068Z
2026-07-30 – 2026-07-3022026-10-20T21:25:09.3134068Z
2026-07-29 – 2026-07-2922026-10-20T21:25:09.3134068Z
2026-07-28 – 2026-07-2822026-10-20T21:25:09.3134068Z
2026-07-27 – 2026-07-2722026-10-20T21:25:09.3134068Z
2026-07-24 – 2026-07-2442026-10-20T21:25:09.3134068Z
2026-07-23 – 2026-07-2352026-10-20T21:25:09.3134068Z
2026-07-22 – 2026-07-2222026-10-20T21:25:09.3134068Z

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.2.219 Mar 20262

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 19:54 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:24a75022e2b6f30001707c8e81ef0d7899e248726bbd59c7f846be3cf6597acf