@bot.message_handler(content_types=["text1"])
def text1(message):
chat_id = message.chat.id
if message.text == 'Отправить заявку':
bot.send_message(chat.id, "Впиши заявку")
bot.register_next_step_handler(message, send_r)
def send_r(massage):
first_name = massage.chat.first_name
chat_id = massage.chat.id
user_name = massage.chat.username
r = massage.text
admin_id = -100...229
app_text = []
app_name = []
app_username = []
app_name.append(first_name)
app_username.append(user_name)
app_text.append(r)
bot.send_message(admin_id, f"Заявка от {app_name} !\n"
f"Его username = {app_username}\n"
f"Его текст:\n"
f"{app_text}")
app_name.clear()
app_username.clear()
app_text.clear()
bot.send_message(chat_id, "Заявка отправлена")
bot.register_next_step_handler(message, message_for_admin)
UnboundLocalError: local variable 'message_for_admin' referenced before assignment