Skip to main content

Telegram bot middleware for Steeper — intercepts updates and outgoing messages to sync with the Steeper platform.

Project description

Steeper

Telegram bot middleware that syncs incoming user messages and outgoing bot replies with the Steeper platform.

Installation

# Core (pick one extra for your framework)
pip install steeper[aiogram]     # aiogram v3
pip install steeper[telebot]     # pyTelegramBotAPI
pip install steeper[ptb]         # python-telegram-bot v20+

Configuration

Every integration requires three values:

Parameter Description
base_url Steeper backend URL (e.g. http://localhost:8000)
bot_id UUID of the bot registered in Steeper
bot_token Raw Telegram bot token from BotFather

Usage

aiogram v3

from aiogram import Bot, Dispatcher
from steeper.integrations.aiogram import SteeperMiddleware

BOT_TOKEN = "123456:ABC-DEF..."
bot = Bot(token=BOT_TOKEN)
dp = Dispatcher()

steeper = SteeperMiddleware(
    base_url="http://localhost:8000",
    bot_id="your-bot-uuid",
    bot_token=BOT_TOKEN,
)
steeper.setup(dp, bot)

# ... register your handlers as usual ...
dp.run_polling(bot)

pyTelegramBotAPI (telebot)

import telebot
from steeper.integrations.telebot import SteeperMiddleware

BOT_TOKEN = "123456:ABC-DEF..."
bot = telebot.TeleBot(BOT_TOKEN)

steeper = SteeperMiddleware(
    base_url="http://localhost:8000",
    bot_id="your-bot-uuid",
    bot_token=BOT_TOKEN,
)
steeper.setup(bot)

# ... register your handlers as usual ...
bot.polling()

python-telegram-bot v20+

from telegram.ext import ApplicationBuilder
from steeper.integrations.ptb import SteeperMiddleware

BOT_TOKEN = "123456:ABC-DEF..."
app = ApplicationBuilder().token(BOT_TOKEN).build()

steeper = SteeperMiddleware(
    base_url="http://localhost:8000",
    bot_id="your-bot-uuid",
    bot_token=BOT_TOKEN,
)
steeper.setup(app)

# ... register your handlers as usual ...
app.run_polling()

How it works

  1. Incoming messages — the middleware intercepts every Telegram Update, serializes it to the standard Telegram JSON format, and POSTs it to the Steeper webhook endpoint. Your handlers still run normally.

  2. Outgoing messagesBot.send_message is patched so that every bot reply is also logged to the Steeper bot-message endpoint.

Both operations are fire-and-forget: if the Steeper backend is unreachable, a warning is logged but your bot continues to work.

License

MIT

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

steeper-0.1.0.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

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

steeper-0.1.0-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file steeper-0.1.0.tar.gz.

File metadata

  • Download URL: steeper-0.1.0.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for steeper-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b40b73a6b986b37d3bb257b5e4653cd5ef5fadcf13f37355ca7f9364e7d1f749
MD5 9dee3dac4891a0d2dcc42e5bb4c85a88
BLAKE2b-256 814465ad717da975265a44fde0f84101303ee3e7b01deb82462442f4d66090d5

See more details on using hashes here.

File details

Details for the file steeper-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: steeper-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for steeper-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1630c33d30e1db743407f5feab1ba1d2cf891d79bd5846d9141552c300feeeb4
MD5 5235c347ffad1f84da78992c574c68c1
BLAKE2b-256 708bac786c0479aab0c2c0b453d40e75fea51a5139381ff76792820a0a78d783

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