fix start command in telegram bot

This commit is contained in:
2025-12-12 21:17:49 +05:00
parent 9ff2319990
commit c7454cbb62

View File

@ -5,6 +5,7 @@ from aiogram.types import Update, Message
from aiogram.fsm.state import State, StatesGroup
from aiogram.fsm.context import FSMContext
from aiogram.fsm.storage.memory import MemoryStorage
from aiogram.filters import CommandStart, CommandObject
from app.services.auth import AuthService
@ -26,11 +27,10 @@ class Register(StatesGroup):
# ===== Handlers =====
@dp.message(F.text == "/start")
async def start(message: Message, state: FSMContext):
args = message.text.split()
if len(args) > 1:
await state.update_data(username=args[1])
@dp.message(CommandStart())
async def start(message: Message, state: FSMContext, command: CommandObject):
if command.args:
await state.update_data(username=command.args)
await state.set_state(Register.code)
await message.answer("📋 Введите код из лаунчера:")
else: