bot.py
def location_handler(message):
    """If the message content type is location.

       if the bot state for a message/call sender is POINT, switch to the Transit state,
       save the location, send the assigned answer and the 'Yes, No' markup.

       elif the bot state for a message/call sender is POLYGON,
       save the location, send the assigned answer and the 'Done' markup."""
    ans = answers['COORD_NS']
    markup = telebot.types.InlineKeyboardMarkup()

    if state.show_state(message) == state.states['POINT']:
        state.save_state(message, state.states['TRANSIT'])
        ans = coord.point_location(message)
        markup.add(telebot.types.InlineKeyboardButton('Yes', callback_data='yes'),
                   telebot.types.InlineKeyboardButton('No', callback_data='no'))
    elif state.show_state(message) == state.states['POLYGON']:
        ans = coord.polygon_location(message)
        markup.add(telebot.types.InlineKeyboardButton('Done', callback_data='done'))

    bot.send_message(message.chat.id, ans, parse_mode='HTML', reply_markup=markup)
If the message content type is location.

       if the bot state for a message/call sender is POINT, switch to the Transit state,
       save the location, send the assigned answer and the 'Yes, No' markup.

       elif the bot state for a message/call sender is POLYGON,
       save the location, send the assigned answer and the 'Done' markup.
If the message content type is location.
if the bot state for a message/call sender is POINT, switch to the Transit state,
save the location, send the assigned answer and the 'Yes, No' markup.

elif the bot state for a message/call sender is POLYGON,
save the location, send the assigned answer and the 'Done' markup.
If the message content type is location . if the bot state for a message / call sender is POINT switch to the Transit state save the location send the assigned answer and the ' Yes No ' markup . elif the bot state for a message / call sender is POLYGON save the location send the assigned answer and the ' Done ' markup .
def location_handler(message):
    ans = answers['COORD_NS']
    markup = telebot.types.InlineKeyboardMarkup()
    if state.show_state(message) == state.states['POINT']:
        state.save_state(message, state.states['TRANSIT'])
        ans = coord.point_location(message)
        markup.add(telebot.types.InlineKeyboardButton('Yes', callback_data='yes'),
                   telebot.types.InlineKeyboardButton('No', callback_data='no'))
    elif state.show_state(message) == state.states['POLYGON']:
        ans = coord.polygon_location(message)
        markup.add(telebot.types.InlineKeyboardButton('Done', callback_data='done'))
    bot.send_message(message.chat.id, ans, parse_mode='HTML', reply_markup=markup)
def location_handler ( message ) : ans = answers [ 'COORD_NS' ] markup = telebot . types . InlineKeyboardMarkup ( ) if state . show_state ( message ) == state . states [ 'POINT' ] : state . save_state ( message , state . states [ 'TRANSIT' ] ) ans = coord . point_location ( message ) markup . add ( telebot . types . InlineKeyboardButton ( 'Yes' , callback_data = 'yes' ) , telebot . types . InlineKeyboardButton ( 'No' , callback_data = 'no' ) ) elif state . show_state ( message ) == state . states [ 'POLYGON' ] : ans = coord . polygon_location ( message ) markup . add ( telebot . types . InlineKeyboardButton ( 'Done' , callback_data = 'done' ) ) bot . send_message ( message . chat . id , ans , parse_mode = 'HTML' , reply_markup = markup )
If the message content type is location.
If the message content type is location .
"""If the message content type is location.

       if the bot state for a message/call sender is POINT, switch to the Transit state,
       save the location, send the assigned answer and the 'Yes, No' markup.

       elif the bot state for a message/call sender is POLYGON,
       save the location, send the assigned answer and the 'Done' markup."""
message