
Security News
Django Joins curl in Pushing Back on AI Slop Security Reports
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
Mubble is a next-generation framework known for its great speed and simplicity. It is written using aiohttp, asyncio, and msgspec.
(Author's words)
Make the fastest bot ever!
Each test contains 100 different API calls
Test | Mubble (sec/avg) | Aiogram (sec/avg) | Telebot (sec/avg) | Winner |
---|---|---|---|---|
1 | 0.12896 | 0.30656 | 0.24000 | Mubble |
2 | 0.12620 | 0.14554 | 0.17649 | Mubble |
3 | 0.13366 | 0.14902 | 0.13141 | Mubble |
4 | 0.12437 | 0.14864 | 0.13717 | Mubble |
5 | 0.12754 | 0.15863 | 0.18894 | Mubble |
6 | 0.12261 | 0.15175 | 0.17157 | Mubble |
7 | 0.14395 | 0.16154 | 0.19383 | Mubble |
8 | 0.12508 | 0.15084 | 0.24207 | Mubble |
9 | 0.12239 | 0.14838 | 0.14282 | Mubble |
10 | 0.12610 | 0.14478 | 0.13068 | Mubble |
AVG | 0.12869 | 0.16687 | 0.17550 | Mubble |
pip install mubble
poetry add mubble
poetry add git+https://github.com/vladislavkovalskyi/mubble.git#master
import random
from mubble import Token, API, Mubble, Message, CallbackQueryEq
from mubble.rules import StartCommand, Text, Markup, CallbackData
from mubble.tools.keyboard import InlineKeyboard, InlineButton
api = API(Token("Your token"))
bot = Mubble(api)
class Keyboard:
menu = (
InlineKeyboard()
.add(InlineButton("βοΈ Write hello", callback_data="hello"))
.row()
.add(InlineButton("π Choice banana", callback_data="banana"))
).get_markup()
back = (
InlineKeyboard().add(InlineButton("β¬
οΈ Back", callback_data="menu"))
).get_markup()
@bot.on.message(StartCommand())
async def start_handler(message: Message):
await message.answer(
"π Hello, I'm Mubble! How can I help you?\n\n"
"My available commands:\n"
"- /start\n"
"- /menu\n"
"- /random [from number] [to number]"
)
@bot.on.message(Text("/menu"))
async def menu_handler(message: Message):
await message.answer(
"π Here's your menu! Use the keyboard.", reply_markup=Keyboard.menu
)
@bot.on.message(Markup(["/random", "/random <a:int> <b:int>"]))
async def random_handler(message: Message, a: int = None, b: int = None):
if None in (a, b):
await message.answer(
"π€ Wrong syntax. You also need to write the first number and the second number."
)
return
await message.answer(f"π² Your random number is {random.randint(a, b)}")
@bot.on.callback_query(CallbackQueryEq("menu"))
async def menu_handler(cq: CallbackQuery):
await cq.edit_text(
"π Here's your menu! Use the keyboard.", reply_markup=Keyboard.menu
)
@bot.on.callback_query(CallbackQueryEq("hello"))
async def hello_handler(cq: CallbackQuery):
await cq.edit_text("π Hello, I'm Mubble!", reply_markup=Keyboard.back)
@bot.on.callback_query(CallbackQueryEq("banana"))
async def fruits_handler(cq: CallbackQuery):
await cq.answer("You clicked on the π!")
bot.run_forever()
Π‘Π»Π°Π²Π° Π£ΠΊΡΠ°ΡΠ½Ρ! πΊπ¦
by Vladyslav Kovalskyi
FAQs
Modern Async Telegram framework for bot building
We found that mubble demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.Β It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.