Can't send a message after receiving the contact in the telebot. What is the error?

import telebot
from telebot import types

username = []


API_TOKEN = '1154777357:AAEDqyy1BQXUWuE#CTszbdU'


bot = telebot.TeleBot(API_TOKEN)

keyboard1 = types.ReplyKeyboardMarkup(True, True)
button_phone = types.Keyboardbutton to(text="Log in" request_contact=True)
keyboard1.add(button_phone)
keyboard = telebot.types.InlineKeyboardMarkup()
callback_button = telebot.types.InlineKeyboardButton(text="Accept", callback_data="accept")
keyboard.add(callback_button)
keyboard2 = telebot.types.InlineKeyboardMarkup()
callback1_button = telebot.types.InlineKeyboardButton(text="Yes", callback_data="yes")
callback2_button = telebot.types.InlineKeyboardButton(text="No" callback_data="no")
keyboard2.add(callback1_button, callback2_button)



@bot.message_handler(commands=['start'])
def send_welcome(message):
 bot.send_message(chat_id=message.chat.id, text='Hello, welcome to VIP Bot. User agreement.', reply_markup=keyboard)
print(message)
 @bot.callback_query_handler(func=lambda call: True)
@bot.message_handler(commands=['number'])
 def callback_data(call):
 if call.data == "accept":
 bot.send_message(chat_id=call.message.chat.id, text='Query number',reply_markup=keyboard1)


@bot.message_handler(content_types=['contact'])
def contact(message):
 if message.contact is not None:
print(message.contact)
 @bot.message_handler(func=lambda message: True, content_types=['text'])
 def send_text(message):
 bot.send_message(chat_id=call.message.chat.id, text='please Answer a few questions!')
 @bot.message_handler(func=lambda message: True, content_types=['text'])
 def username(message):
 global username
username.append(message.text)
 bot.send_message(chat_id=call.message.chat.id, text='Question 1', reply_markup=keyboard2)
 @bot.message_handler(func=lambda message: True, content_types=['text'])
 def username(message):
 global username
username.append(message.text)
 bot.send_message(chat_id=call.message.chat.id, text='Question 2', reply_markup=keyboard2)

bot.polling()
April 19th 20 at 12:37
0 answer

Find more questions by tags Telegram