예제 #1
0
def send_welcome(message):
    chat_id = message.chat.id
    markup = types.ReplyKeyboardRemove()
    if not exist_user(chat_id):
        user = User()
        user.chat_id = chat_id
        user_dict[chat_id] = user
        msg = bot.reply_to(
            message,
            'Привет. Ты здесь впервые, поэтому давай зарегистрируемся. Введи свои ФИО.',
            reply_markup=markup)
        bot.register_next_step_handler(msg, process_name_step)
    else:
        user = exist_user(chat_id)
        user_dict[chat_id] = user
        st = 'Привет, {}. Ты как всегда можешь узнать информацию о себе набрав "/info"'.format(
            user.name)
        msg = bot.reply_to(message, st, reply_markup=markup)
        bot.register_next_step_handler(msg, process_info_stage)