chore(telegram_bot): small improvements

This commit is contained in:
ITQ
2025-02-20 22:12:58 +03:00
parent 2390b24323
commit 8d7ff22d7a
3 changed files with 6 additions and 5 deletions
@@ -18,7 +18,8 @@ async def start_command(
if state_data["authenticated"]: if state_data["authenticated"]:
await message.answer( await message.answer(
"Already authenticated as" "Already authenticated as"
f" <code>{state_data['advertiser']['name']}</code>" f" <code>{state_data['advertiser']['name']}</code> "
f"(<code>{state_data['advertiser']['advertiser_id']}</code>)"
) )
return return
@@ -7,10 +7,10 @@ from aiogram_dialog import DialogManager
from api.client import AdNovaClient from api.client import AdNovaClient
from filters.auth import AuthenticatedFilter from filters.auth import AuthenticatedFilter
stats_router = Router() statistics_router = Router()
@stats_router.message(Command("stats"), AuthenticatedFilter()) @statistics_router.message(Command("statistics"), AuthenticatedFilter())
async def stats_command( async def stats_command(
message: Message, dialog_manager: DialogManager, state: FSMContext message: Message, dialog_manager: DialogManager, state: FSMContext
) -> None: ) -> None:
+2 -2
View File
@@ -10,7 +10,7 @@ import config
from commands.campaigns import campaigns_router from commands.campaigns import campaigns_router
from commands.logout import logout_router from commands.logout import logout_router
from commands.start import start_router from commands.start import start_router
from commands.stats import stats_router from commands.stats import statistics_router
from dialogs.campaigns import campaigns_dialog from dialogs.campaigns import campaigns_dialog
from dialogs.start import start_dialog from dialogs.start import start_dialog
from middlewares.auth import AuthMiddleware from middlewares.auth import AuthMiddleware
@@ -45,7 +45,7 @@ async def main() -> None:
dp.include_routers( dp.include_routers(
start_router, start_router,
campaigns_router, campaigns_router,
stats_router, statistics_router,
logout_router, logout_router,
) )
dp.include_routers(start_dialog, campaigns_dialog) dp.include_routers(start_dialog, campaigns_dialog)