
Product
Socket Now Protects the Chrome Extension Ecosystem
Socket is launching experimental protection for Chrome extensions, scanning for malware and risky permissions to prevent silent supply chain attacks.
✨ A minimalistic UI framework for aiogram bots. Devlog - https://t.me/aiogramui/
pip install aiogramui
Let's create start page and child page "Wallet":
from aiogramui import *
init(router)
startpage = Root('start', backtext='Back')
wallet = startpage.page('Wallet')
@startpage
@router.message(Command('start'))
async def on_start(msg: Message, keyboard=None):
await msg.answer('start page', reply_markup=startpage.keyboard(msg).as_markup())
@wallet
async def on_wallet(msg: Message, keyboard=None):
await msg.answer('wallet page', reply_markup=keyboard.as_markup())
register()
init()
and register()
are required. Root()
- a root page that doesn't have back button. All pages has elements functions, to learn more about them, keep read.
Root.dialog(text, *filters)
Usage:
users = {
'evr4': '1234',
'evryoneowo': '1337',
'bestusr': '111111'
}
login = start.dialog('Log in')
@passwd.arg('Enter your login')
async def on_login(msg: Message, args):
login = args[0]
if login not in users: return # If user entered not valid login then it will ask him again.
@passwd.arg('Enter the password')
async def on_passwd(msg: Message, args):
password = users[args[0]]
entered_password = args[1]
if password != entered_password: await login.cancel(msg) # If user entered not valid password then it will cancel dialog.
await msg.answer(f'Welcome, {args[0]}!')
Root.button(text, *filters)
Usage:
hwbtn = start.button('Click me')
@hwbtn
async def on_hwbtn(msg: Message):
await msg.answer('Hello, World!')
Root.checkbox(off, on, *filters, default=False)
Usage:
checkbox = start.checkbox('off', 'on')
@checkbox
async def on_checkbox(msg: Message, state):
await msg.answer(f'State: {state}')
You can also save values of checkboxes for loading them later using chats
arg in checkbox()
.
handle(cqdata, *filters)
Usage: If you has inline keyboard with cqdata "delete" that deletes message:
@handle(data == 'hi')
async def on_hi(cq: CallbackQuery):
await cq.message.delete()
You can use filters at pages or elements. e.g.
from aiogramui.filters import UserFilter
admins = [12453, 21546, 69283]
adminpage = start.page('Admin', UserFilter(admin))
@adminpage
async def on_adminpage(msg: Message, keyboard):
await msg.answer('Admin page', reply_markup=keyboard.as_markup())
doc = start.generate_doc()
It will generate docs of your menu using docstrings for descriptions.
FAQs
A minimalistic UI framework for aiogram bots.
We found that aiogramui 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.
Product
Socket is launching experimental protection for Chrome extensions, scanning for malware and risky permissions to prevent silent supply chain attacks.
Product
Add secure dependency scanning to Claude Desktop with Socket MCP, a one-click extension that keeps your coding conversations safe from malicious packages.
Product
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.