bot.py
def message_handler(message):
    """If the bot state for a message/call sender is QUESTION1.

       Validate the message, save the question, switch to the QUESTION2 state,
       send the assigned answer and the 'Next, Done. Delete' markup"""
    ans = qa.question_insert(message)
    markup = telebot.types.InlineKeyboardMarkup()

    if ans == answers['LONG']:
        pass
    else:
        state.save_state(message, state.states['QUESTION2'])
        markup.add(telebot.types.InlineKeyboardButton('Next', callback_data='next'),
                   telebot.types.InlineKeyboardButton('Done', callback_data='done'),
                   telebot.types.InlineKeyboardButton('Delete', callback_data='delete'))

    bot.send_message(message.chat.id, ans, parse_mode='HTML', reply_markup=markup)
If the bot state for a message/call sender is QUESTION1.

       Validate the message, save the question, switch to the QUESTION2 state,
       send the assigned answer and the 'Next, Done. Delete' markup
If the bot state for a message/call sender is QUESTION1.
Validate the message, save the question, switch to the QUESTION2 state,
send the assigned answer and the 'Next, Done. Delete' markup
If the bot state for a message / call sender is QUESTION1 . Validate the message save the question switch to the QUESTION2 state send the assigned answer and the ' Next Done . Delete ' markup
def message_handler(message):
    ans = qa.question_insert(message)
    markup = telebot.types.InlineKeyboardMarkup()
    if ans == answers['LONG']:
        pass
    else:
        state.save_state(message, state.states['QUESTION2'])
        markup.add(telebot.types.InlineKeyboardButton('Next', callback_data='next'),
                   telebot.types.InlineKeyboardButton('Done', callback_data='done'),
                   telebot.types.InlineKeyboardButton('Delete', callback_data='delete'))
    bot.send_message(message.chat.id, ans, parse_mode='HTML', reply_markup=markup)
def message_handler ( message ) : ans = qa . question_insert ( message ) markup = telebot . types . InlineKeyboardMarkup ( ) if ans == answers [ 'LONG' ] : pass else : state . save_state ( message , state . states [ 'QUESTION2' ] ) markup . add ( telebot . types . InlineKeyboardButton ( 'Next' , callback_data = 'next' ) , telebot . types . InlineKeyboardButton ( 'Done' , callback_data = 'done' ) , telebot . types . InlineKeyboardButton ( 'Delete' , callback_data = 'delete' ) ) bot . send_message ( message . chat . id , ans , parse_mode = 'HTML' , reply_markup = markup )
If the bot state for a message/call sender is QUESTION1.
If the bot state for a message / call sender is QUESTION1 .
"""If the bot state for a message/call sender is QUESTION1.

       Validate the message, save the question, switch to the QUESTION2 state,
       send the assigned answer and the 'Next, Done. Delete' markup"""
message