18 lines
411 B
Django/Jinja
18 lines
411 B
Django/Jinja
from aiogram import Bot, Router, types
|
|
from rich import print # noqa: A004
|
|
|
|
router = Router()
|
|
|
|
|
|
@router.startup()
|
|
async def startup(bot: Bot) -> None:
|
|
await bot.set_my_commands(
|
|
[types.BotCommand(command="start", description="Start the bot")]
|
|
)
|
|
print(f"[green]Started as[/] @{(await bot.me()).username}")
|
|
|
|
|
|
@router.shutdown()
|
|
async def shutdown() -> None:
|
|
print("Shutting down bot...")
|