import telebot
from telebot import types
group_id = -4283368729
user_dict = {}
# bot = telebot.TeleBot('', threaded=False) # официальный бот
bot = telebot.TeleBot('TOKEN') # тестовый бот
print('bot started')
class User:
pass
@bot.message_handler(commands=['start'])
def start(message):
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
btn1 = types.KeyboardButton("?? Русский")
btn2 = types.KeyboardButton('?? English')
markup.add(btn1, btn2)
bot.send_message(message.from_user.id, "?? Выберите язык / ?? Choose your language", reply_markup=markup)
@bot.message_handler(content_types=['text'])
def message_reply(message):
if message.text == "?? English":
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
item1 = types.KeyboardButton("id cards")
item2 = types.KeyboardButton("check/documents")
item3 = types.KeyboardButton("other")
markup.add(item1, item2, item3)
bot.send_message(message.chat.id, 'Choose what you need', reply_markup=markup)
elif message.text == "?? Русский":
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
item1 = types.KeyboardButton("удостоверение личности")
item2 = types.KeyboardButton("чеки/документы")
item3 = types.KeyboardButton("другое")
markup.add(item1, item2, item3)
bot.send_message(message.chat.id, 'Выберите что вам нужно', reply_markup=markup)
elif message.text == "id cards":
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
item1 = types.KeyboardButton("driver license")
item2 = types.KeyboardButton("passport")
item3 = types.KeyboardButton("back")
markup.add(item1, item2, item3)
bot.send_message(message.chat.id, 'Select a specific category', reply_markup=markup)
elif message.text == "удостоверение личности":
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
item1 = types.KeyboardButton("водительские права")
item2 = types.KeyboardButton("паспорт")
item3 = types.KeyboardButton("назад")
markup.add(item1, item2, item3)
bot.send_message(message.chat.id, 'Выберете определенную категорию', reply_markup=markup)
elif message.text == "назад":
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
item1 = types.KeyboardButton("удостоверение личности")
item2 = types.KeyboardButton("чеки/документы")
item3 = types.KeyboardButton("другое")
markup.add(item1, item2, item3)
bot.send_message(message.chat.id, 'Выберите что вам нужно', reply_markup=markup)
elif message.text == "back":
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
item1 = types.KeyboardButton("id cards")
item2 = types.KeyboardButton("check/documents")
item3 = types.KeyboardButton("other")
markup.add(item1, item2, item3)
bot.send_message(message.chat.id, 'Choose what you need', reply_markup=markup)
elif message.text == "чеки/документы":
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
item2 = types.KeyboardButton('Назад')
nnn = 'Опишите что вам нужно'
markup.add(item2)
bot.send_message(message.chat.id, nnn, reply_markup=markup)
bot.register_next_step_handler(message, process_vod_prav_step)
elif message.text == "да":
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
item1 = types.KeyboardButton("удостоверение личности")
item2 = types.KeyboardButton("чеки/документы")
item3 = types.KeyboardButton("другое")
markup.add(item1, item2, item3)
bot.send_message(group_id, vodi_pav)
bot.send_message(message.chat.id, 'Ожидайте с вами скоро свяжутся', reply_markup=markup)
elif message.text == "yes":
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
item1 = types.KeyboardButton("id cards")
item2 = types.KeyboardButton("check/documents")
item3 = types.KeyboardButton("other")
markup.add(item1, item2, item3)
bot.send_message(group_id, vodi_pav)
bot.send_message(message.chat.id, 'Expect to be contacted soon', reply_markup=markup)
elif message.text == "нет":
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
item1 = types.KeyboardButton("удостоверение личности")
item2 = types.KeyboardButton("чеки/документы")
item3 = types.KeyboardButton("другое")
markup.add(item1, item2, item3)
bot.send_message(message.chat.id, 'Выберите что вам нужно', reply_markup=markup)
elif message.text == "другое":
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
item2 = types.KeyboardButton('Назад')
nnn = 'Опишите что вам нужно'
markup.add(item2)
bot.send_message(message.chat.id, nnn, reply_markup=markup)
bot.register_next_step_handler(message, process_vod_prav_step)
elif message.text == "паспорт":
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
item2 = types.KeyboardButton('Назад')
nnn = 'Опишите что вам нужно'
markup.add(item2)
bot.send_message(message.chat.id, nnn, reply_markup=markup)
bot.register_next_step_handler(message, process_vod_prav_step)
elif message.text == "other":
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
item2 = types.KeyboardButton('Back')
nnn = 'Describe what you need'
markup.add(item2)
bot.send_message(message.chat.id, nnn, reply_markup=markup)
bot.register_next_step_handler(message, process_vod_prav_uk_step)
elif message.text == "not":
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
item1 = types.KeyboardButton("id cards")
item2 = types.KeyboardButton("check/documents")
item3 = types.KeyboardButton("other")
markup.add(item1, item2, item3)
bot.send_message(message.chat.id, 'Choose what you need', reply_markup=markup)
elif message.text == "check/documents":
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
item2 = types.KeyboardButton('Back')
nnn = 'Describe what you need'
markup.add(item2)
bot.send_message(message.chat.id, nnn, reply_markup=markup)
bot.register_next_step_handler(message, process_vod_prav_uk_step)
elif message.text == "passport":
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
item2 = types.KeyboardButton('Back')
nnn = 'Describe what you need'
markup.add(item2)
bot.send_message(message.chat.id, nnn, reply_markup=markup)
bot.register_next_step_handler(message, process_vod_prav_uk_step)
elif message.text == "водительские права":
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
item3 = types.KeyboardButton("назад")
markup.add(item3)
bot.send_message(message.chat.id, 'Напишие страну для прав, с зоглавной буквы \n Катигории и имя фамилию '
'отчество \n Датурождения и получения прав', reply_markup=markup)
bot.register_next_step_handler(message, process_vod_prav_step)
elif message.text == "driver license":
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
item3 = types.KeyboardButton("back")
markup.add(item3)
bot.send_message(message.chat.id, 'Write the country for the license, with a capital letter \n Categories and '
'first name, last name, patronymic \n Date of birth and license',
reply_markup=markup)
bot.register_next_step_handler(message, process_vod_prav_uk_step)
def process_vod_prav_step(message):
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
item2 = types.KeyboardButton("да")
item3 = types.KeyboardButton("нет")
markup.add(item2, item3)
global vodi_pav
user_first_name = str(message.from_user.username)
vodi_pav = message.text + ' user id @' + user_first_name
bot.send_message(message.chat.id, 'Все верно?', reply_markup=markup)
bot.register_next_step_handler(message, message_reply)
def process_vod_prav_uk_step(message):
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
item2 = types.KeyboardButton("yas")
item3 = types.KeyboardButton("not")
markup.add(item2, item3)
global vodi_pav
user_first_name = str(message.from_user.username)
vodi_pav = message.text + ' user id @' + user_first_name
bot.send_message(message.chat.id, 'Is everything correct?', reply_markup=markup)
bot.register_next_step_handler(message, message_reply)
bot.polling(none_stop=True, interval=0)