Archived
feat(bot): add bot account ownership and balance
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
from aiogram import Router
|
||||
from aiogram.types import CallbackQuery
|
||||
|
||||
from bot.services.balance import get_user_profile
|
||||
from bot.ui.keyboards import back_keyboard
|
||||
|
||||
router = Router()
|
||||
|
||||
|
||||
@router.callback_query(lambda c: c.data == "profile")
|
||||
async def profile_handler(callback: CallbackQuery) -> None:
|
||||
telegram_id, balance, bot_count = await get_user_profile(callback.from_user.id)
|
||||
|
||||
await callback.answer()
|
||||
await callback.message.edit_text(
|
||||
f"👤 <b>Профиль</b>\n\n"
|
||||
f"🆔: <code>{telegram_id}</code>\n"
|
||||
f"💰 Баланс: <code>{balance}</code> ₽\n"
|
||||
f"🤖 Ботов: <code>{bot_count}</code>",
|
||||
reply_markup=back_keyboard(),
|
||||
)
|
||||
Reference in New Issue
Block a user