bot.py
def command_handler(message):
    """If the command /start is entered by a message/call sender.

       If there is not any state for a message/call sender, assign the INIT state,
       in all other cases directly return to the first step (SURVEY1 state) from any stage. All not yet
       submitted changes will be lost.

       Send the assigned answer and the 'Create Survey' markup."""
    ans = answers['INTRO2']
    markup = telebot.types.InlineKeyboardMarkup()
    markup.add(telebot.types.InlineKeyboardButton('Create Survey', callback_data='create survey'))

    if state.show_state(message) in [state.states['SURVEY1'], state.states['SURVEY3'], state.states['RESULT'],
                                     state.states['CHECK2'], state.states['COLLECT']]:
        state.save_state(message, state.states['SURVEY1'])
    elif state.show_state(message) == state.states['INIT']:
        state.save_state(message, state.states['SURVEY1'])
        ans = answers['INTRO1'] % message.from_user.first_name
    elif state.show_state(message) in [state.states['QUESTION1'], state.states['QUESTION2']]:
        state.save_state(message, state.states['SURVEY1'])
        ans = answers['INTRO3']
        delete.del_question(message)
    elif state.show_state(message) in [state.states['POINT'], state.states['POLYGON'], state.states['TRANSIT'],
                                       state.states['MEDIA1'], state.states['MEDIA2']]:
        state.save_state(message, state.states['SURVEY1'])
        ans = answers['INTRO3']
        delete.del_feature(message)
    elif state.show_state(message) in [state.states['ANSWER'], state.states['CHECK1']]:
        state.save_state(message, state.states['SURVEY1'])
        delete.del_row(message)
        ans = answers['INTRO3']
    elif state.show_state(message) == state.states['SUBMIT']:
        state.save_state(message, state.states['SURVEY1'])
        if not delete.check_ans(message):
            delete.del_row(message)
            ans = answers['INTRO3']
    elif state.show_state(message) in [state.states['SURVEY2']]:
        state.save_state(message, state.states['SURVEY1'])
        ans = answers['INTRO3']

    bot.send_message(message.chat.id, ans, parse_mode='HTML', reply_markup=markup)
If the command /start is entered by a message/call sender.

       If there is not any state for a message/call sender, assign the INIT state,
       in all other cases directly return to the first step (SURVEY1 state) from any stage. All not yet
       submitted changes will be lost.

       Send the assigned answer and the 'Create Survey' markup.
If the command /start is entered by a message/call sender.
If there is not any state for a message/call sender, assign the INIT state,
in all other cases directly return to the first step (SURVEY1 state) from any stage. All not yet
submitted changes will be lost.

Send the assigned answer and the 'Create Survey' markup.
If the command / start is entered by a message / call sender . If there is not any state for a message / call sender assign the INIT state in all other cases directly return to the first step ( SURVEY1 state ) from any stage . All not yet submitted changes will be lost . Send the assigned answer and the ' Create Survey ' markup .
def command_handler(message):
    ans = answers['INTRO2']
    markup = telebot.types.InlineKeyboardMarkup()
    markup.add(telebot.types.InlineKeyboardButton('Create Survey', callback_data='create survey'))
    if state.show_state(message) in [state.states['SURVEY1'], state.states['SURVEY3'], state.states['RESULT'],
                                     state.states['CHECK2'], state.states['COLLECT']]:
        state.save_state(message, state.states['SURVEY1'])
    elif state.show_state(message) == state.states['INIT']:
        state.save_state(message, state.states['SURVEY1'])
        ans = answers['INTRO1'] % message.from_user.first_name
    elif state.show_state(message) in [state.states['QUESTION1'], state.states['QUESTION2']]:
        state.save_state(message, state.states['SURVEY1'])
        ans = answers['INTRO3']
        delete.del_question(message)
    elif state.show_state(message) in [state.states['POINT'], state.states['POLYGON'], state.states['TRANSIT'],
                                       state.states['MEDIA1'], state.states['MEDIA2']]:
        state.save_state(message, state.states['SURVEY1'])
        ans = answers['INTRO3']
        delete.del_feature(message)
    elif state.show_state(message) in [state.states['ANSWER'], state.states['CHECK1']]:
        state.save_state(message, state.states['SURVEY1'])
        delete.del_row(message)
        ans = answers['INTRO3']
    elif state.show_state(message) == state.states['SUBMIT']:
        state.save_state(message, state.states['SURVEY1'])
        if not delete.check_ans(message):
            delete.del_row(message)
            ans = answers['INTRO3']
    elif state.show_state(message) in [state.states['SURVEY2']]:
        state.save_state(message, state.states['SURVEY1'])
        ans = answers['INTRO3']
    bot.send_message(message.chat.id, ans, parse_mode='HTML', reply_markup=markup)
def command_handler ( message ) : ans = answers [ 'INTRO2' ] markup = telebot . types . InlineKeyboardMarkup ( ) markup . add ( telebot . types . InlineKeyboardButton ( 'Create Survey' , callback_data = 'create survey' ) ) if state . show_state ( message ) in [ state . states [ 'SURVEY1' ] , state . states [ 'SURVEY3' ] , state . states [ 'RESULT' ] , state . states [ 'CHECK2' ] , state . states [ 'COLLECT' ] ] : state . save_state ( message , state . states [ 'SURVEY1' ] ) elif state . show_state ( message ) == state . states [ 'INIT' ] : state . save_state ( message , state . states [ 'SURVEY1' ] ) ans = answers [ 'INTRO1' ] % message . from_user . first_name elif state . show_state ( message ) in [ state . states [ 'QUESTION1' ] , state . states [ 'QUESTION2' ] ] : state . save_state ( message , state . states [ 'SURVEY1' ] ) ans = answers [ 'INTRO3' ] delete . del_question ( message ) elif state . show_state ( message ) in [ state . states [ 'POINT' ] , state . states [ 'POLYGON' ] , state . states [ 'TRANSIT' ] , state . states [ 'MEDIA1' ] , state . states [ 'MEDIA2' ] ] : state . save_state ( message , state . states [ 'SURVEY1' ] ) ans = answers [ 'INTRO3' ] delete . del_feature ( message ) elif state . show_state ( message ) in [ state . states [ 'ANSWER' ] , state . states [ 'CHECK1' ] ] : state . save_state ( message , state . states [ 'SURVEY1' ] ) delete . del_row ( message ) ans = answers [ 'INTRO3' ] elif state . show_state ( message ) == state . states [ 'SUBMIT' ] : state . save_state ( message , state . states [ 'SURVEY1' ] ) if not delete . check_ans ( message ) : delete . del_row ( message ) ans = answers [ 'INTRO3' ] elif state . show_state ( message ) in [ state . states [ 'SURVEY2' ] ] : state . save_state ( message , state . states [ 'SURVEY1' ] ) ans = answers [ 'INTRO3' ] bot . send_message ( message . chat . id , ans , parse_mode = 'HTML' , reply_markup = markup )
If the command /start is entered by a message/call sender.
If the command / start is entered by a message / call sender .
"""If the command /start is entered by a message/call sender.

       If there is not any state for a message/call sender, assign the INIT state,
       in all other cases directly return to the first step (SURVEY1 state) from any stage. All not yet
       submitted changes will be lost.

       Send the assigned answer and the 'Create Survey' markup."""
message