import telebot
from telebot import types
import os
username = []
API_TOKEN = ''
bot = telebot.TeleBot(API_TOKEN)
@bot.message_handler(commands=['start'])
def send_welcome(message):
keyboard1 = types.ReplyKeyboardMarkup(True, True)
button_phone = types.KeyboardButton(text="Авторизоваться", request_contact=True)
keyboard1.add(button_phone)
keyboard = telebot.types.InlineKeyboardMarkup()
callback_button = telebot.types.InlineKeyboardButton(text="Принять", callback_data="accept")
keyboard.add(callback_button)
keyboard2 = telebot.types.InlineKeyboardMarkup()
callback1_button = telebot.types.InlineKeyboardButton(text="Да", callback_data="yes")
callback2_button = telebot.types.InlineKeyboardButton(text="Нет", callback_data="no")
keyboard2.add(callback1_button, callback2_button)
keyboard3 = telebot.types.InlineKeyboardMarkup()
inline_1button = telebot.types.InlineKeyboardButton(text="Начать", callback_data="st1art")
keyboard3.add(inline_1button)
bot.send_message(chat_id=message.chat.id, text='Здравствуйте, вас приветствует VIP Bot. Пользовательское соглашение.', reply_markup=keyboard)
print(message)
@bot.message_handler(content_types=['text'])
@bot.callback_query_handler(func=lambda call: True)
def callback_data(call):
if call.data == "accept":
bot.send_message(chat_id=call.message.chat.id, text='Запрос номера',reply_markup=keyboard1)
@bot.message_handler(content_types=['contact'])
def contact(message):
if message.contact is not None:
print(message.contact)
bot.send_message(chat_id=message.chat.id, text='Ответьте на несколько вопрсов', reply_markup=keyboard3)
@bot.callback_query_handler(func=lambda call: True)
def callback_data(call):
if call.data == "st1art":
bot.send_message(chat_id=call.message.chat.id, text='Вопрос 1', reply_markup=keyboard2)
bot.polling(none_stop=True)