feat: deeplink in bot
All checks were successful
Build and Deploy / deploy (push) Successful in 21s

This commit is contained in:
2025-07-21 09:47:32 +05:00
parent 7ab955dbb4
commit 6e2742bc09

View File

@ -12,8 +12,14 @@ user_states = {} # {"chat_id": {"username": "DIKER0K"}}
@bot.message_handler(commands=['start'])
def start(message):
bot.reply_to(message, "🔑 Введите ваш игровой никнейм:")
bot.register_next_step_handler(message, process_username)
# Обработка deep link: /start{username}
if len(message.text.split()) > 1:
username = message.text.split()[1] # Получаем username из ссылки
user_states[message.chat.id] = {"username": username}
bot.reply_to(message, f"📋 Введите код из лаунчера:")
else:
bot.reply_to(message, "🔑 Введите ваш игровой никнейм:")
bot.register_next_step_handler(message, process_username)
def process_username(message):
user_states[message.chat.id] = {"username": message.text.strip()}