Advanced, lightweight wrapper for Aiogram 3.x with inline buttons and regex support.
Project description
easyaiogram
🚀 easyaiogram is a lightweight and beginner-friendly wrapper built on top of Aiogram 3.x.
It helps you create Telegram bots faster with clean decorators, simple keyboard helpers, callback handlers, and less boilerplate code.
✨ Features
- ⚡ Easy bot initialization
- 🧩 Command handlers
- 💬 Text handlers
- 🔎 Contains text handlers
- 🧪 Regex handlers
- 🔘 Callback query handlers
- ⌨️ Reply keyboard generator
- 📲 Inline keyboard generator
- 📤 Message, photo, and document helpers
- 🚀 Simple
start()andrun()methods
📦 Installation
pip install easyaiogram
🚀 Quick Start
from easyaiogram import EasyAiogram
from aiogram.types import Message, CallbackQuery
bot = EasyAiogram(token="YOUR_BOT_TOKEN")
menu = bot.make_buttons(["Features", "GitHub", "Support"], row_width=2)
inline_menu = bot.make_inline_buttons(["Profile", "Settings", "Help"], row_width=2)
@bot.on_command("start")
async def start(message: Message):
await message.answer("Welcome to easyaiogram!", reply_markup=menu)
@bot.on_text("features")
async def features(message: Message):
await message.answer("easyaiogram makes Aiogram easier and cleaner.")
@bot.on_contains("help")
async def help_handler(message: Message):
await message.answer("How can I help you?")
@bot.on_regex(r"^\d+$")
async def number_handler(message: Message):
await message.answer("You sent a number.")
@bot.on_callback("btn:1")
async def profile_callback(callback: CallbackQuery):
await callback.answer("Profile clicked!")
if __name__ == "__main__":
bot.start()
🧠 Usage
Create Bot
from easyaiogram import EasyAiogram
bot = EasyAiogram(token="YOUR_BOT_TOKEN")
Command Handler
@bot.on_command("start")
async def start(message):
await message.answer("Hello!")
Text Handler
@bot.on_text("hello")
async def hello(message):
await message.answer("Hi!")
Contains Handler
@bot.on_contains("help")
async def help_handler(message):
await message.answer("How can I help you?")
Regex Handler
@bot.on_regex(r"^\d+$")
async def number_handler(message):
await message.answer("You sent a number.")
Callback Handler
@bot.on_callback("btn:1")
async def callback_handler(callback):
await callback.answer("Button clicked!")
⌨️ Reply Keyboard
menu = bot.make_buttons(
["Profile", "Settings", "Help"],
row_width=2
)
await message.answer("Choose:", reply_markup=menu)
🔘 Inline Keyboard
inline_menu = bot.make_inline_buttons(
["Profile", "Settings", "Help"],
row_width=2
)
await message.answer("Choose:", reply_markup=inline_menu)
Default callback data:
btn:1
btn:2
btn:3
Custom callback prefix:
inline_menu = bot.make_inline_buttons(
["Profile", "Settings", "Help"],
row_width=2,
callback_prefix="menu"
)
Generated callback data:
menu:1
menu:2
menu:3
📤 Helper Methods
await bot.send(chat_id, "Hello!")
await bot.answer(message, "Hello!")
await bot.reply(message, "Reply text")
await bot.edit_callback(callback, "Updated text")
await bot.send_photo(chat_id, photo="photo_url")
await bot.send_document(chat_id, document="file_url")
▶️ Start Bot
bot.start()
or:
bot.run()
🔥 Why easyaiogram?
Standard Aiogram requires more setup:
import asyncio
from aiogram import Bot, Dispatcher
bot = Bot("TOKEN")
dp = Dispatcher()
async def main():
await dp.start_polling(bot)
asyncio.run(main())
With easyaiogram:
from easyaiogram import EasyAiogram
bot = EasyAiogram("TOKEN")
bot.start()
📌 Requirements
- Python 3.10+
- Aiogram 3.x
📄 License
MIT License
Made with ❤️ for Python and Telegram bot developers.
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
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 easy_aiogram_bot-1.2.1.tar.gz.
File metadata
- Download URL: easy_aiogram_bot-1.2.1.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
44cafdde91cdc00ce3b7e4d28b07e4c04d379c3ddf3ba2a3534b579e70b25fd4
|
|
| MD5 |
2041b48a7bb26e0aaadb690a2384fa99
|
|
| BLAKE2b-256 |
cde792d6913ced57f39b8cf924fa0beaa622478d6b2a8508ca1b73e73dc8ba66
|
File details
Details for the file easy_aiogram_bot-1.2.1-py3-none-any.whl.
File metadata
- Download URL: easy_aiogram_bot-1.2.1-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fddc13836e45b7dd668f3d4f83c1f552c004c2bcf70779d23dec1200f7d9ca0f
|
|
| MD5 |
8f5bc4cd125f324984e1599391c12513
|
|
| BLAKE2b-256 |
8080cbd96b9b956238c507d6832c64e748e1cbbc28cbc4867aab67e05d8984b1
|