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

       if an entered survey name does not exist. Validate it,
       switch to the QUESTION1 state, save the name. Send the assigned answer.

       else, send the assigned answer. """
    ans = answers['EXIST']

    if not survey.survey_check(message):
        if len(message.text) < 4:
            ans = answers['MIN_SYMBOL']
        else:
            ans = answers['LONG']
            if survey.save_survey(message):
                pass
            else:
                state.save_state(message, state.states['QUESTION1'])
                ans = survey.survey_initial(message)

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

       if an entered survey name does not exist. Validate it,
       switch to the QUESTION1 state, save the name. Send the assigned answer.

       else, send the assigned answer. 
If the bot state for a message/call sender is SURVEY2.
if an entered survey name does not exist. Validate it,
switch to the QUESTION1 state, save the name. Send the assigned answer.

else, send the assigned answer.
If the bot state for a message / call sender is SURVEY2 . if an entered survey name does not exist . Validate it switch to the QUESTION1 state save the name . Send the assigned answer . else send the assigned answer .
def message_handler(message):
    ans = answers['EXIST']
    if not survey.survey_check(message):
        if len(message.text) < 4:
            ans = answers['MIN_SYMBOL']
        else:
            ans = answers['LONG']
            if survey.save_survey(message):
                pass
            else:
                state.save_state(message, state.states['QUESTION1'])
                ans = survey.survey_initial(message)
    bot.send_message(message.chat.id, ans, parse_mode='HTML')
def message_handler ( message ) : ans = answers [ 'EXIST' ] if not survey . survey_check ( message ) : if len ( message . text ) < 4 : ans = answers [ 'MIN_SYMBOL' ] else : ans = answers [ 'LONG' ] if survey . save_survey ( message ) : pass else : state . save_state ( message , state . states [ 'QUESTION1' ] ) ans = survey . survey_initial ( message ) bot . send_message ( message . chat . id , ans , parse_mode = 'HTML' )
If the bot state for a message/call sender is SURVEY2.
If the bot state for a message / call sender is SURVEY2 .
"""If the bot state for a message/call sender is SURVEY2.

       if an entered survey name does not exist. Validate it,
       switch to the QUESTION1 state, save the name. Send the assigned answer.

       else, send the assigned answer. """
message