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

       if call.data is 'done' and the number of vertices >= 4,
       switch to the TRANSIT state, create a POLYGON geometry
       in the features table, send the assigned answer and the
       'Yes, No' markup

       elif call.data is done and the number of vertices < 4,
       send the assigned answer."""
    bot.answer_callback_query(call.id)

    markup = telebot.types.InlineKeyboardMarkup()

    if call.data == 'done' and coord.get_count(call) >= 4:
        state.save_state(call, state.states['TRANSIT'])
        ans = coord.polygon_create(call, coord.get_poly_points(call).split(','))
        markup.add(telebot.types.InlineKeyboardButton('Yes', callback_data='yes'),
                   telebot.types.InlineKeyboardButton('No', callback_data='no'))
        bot.send_message(call.message.chat.id, ans, parse_mode='HTML', reply_markup=markup)
    elif call.data == 'done' and coord.get_count(call) < 4:
        ans = answers['VERTICES'] % coord.get_count(call)
        bot.send_message(call.message.chat.id, ans, parse_mode='HTML')
If the bot state for a message/call sender is POLYGON.

       if call.data is 'done' and the number of vertices >= 4,
       switch to the TRANSIT state, create a POLYGON geometry
       in the features table, send the assigned answer and the
       'Yes, No' markup

       elif call.data is done and the number of vertices < 4,
       send the assigned answer.
If the bot state for a message/call sender is POLYGON.
if call.data is 'done' and the number of vertices >= 4,
switch to the TRANSIT state, create a POLYGON geometry
in the features table, send the assigned answer and the
'Yes, No' markup

elif call.data is done and the number of vertices < 4,
send the assigned answer.
If the bot state for a message / call sender is POLYGON . if call . data is ' done ' and the number of vertices > = 4 switch to the TRANSIT state create a POLYGON geometry in the features table send the assigned answer and the ' Yes No ' markup elif call . data is done and the number of vertices < 4 send the assigned answer .
def callback_handler(call):
    bot.answer_callback_query(call.id)
    markup = telebot.types.InlineKeyboardMarkup()
    if call.data == 'done' and coord.get_count(call) >= 4:
        state.save_state(call, state.states['TRANSIT'])
        ans = coord.polygon_create(call, coord.get_poly_points(call).split(','))
        markup.add(telebot.types.InlineKeyboardButton('Yes', callback_data='yes'),
                   telebot.types.InlineKeyboardButton('No', callback_data='no'))
        bot.send_message(call.message.chat.id, ans, parse_mode='HTML', reply_markup=markup)
    elif call.data == 'done' and coord.get_count(call) < 4:
        ans = answers['VERTICES'] % coord.get_count(call)
        bot.send_message(call.message.chat.id, ans, parse_mode='HTML')
def callback_handler ( call ) : bot . answer_callback_query ( call . id ) markup = telebot . types . InlineKeyboardMarkup ( ) if call . data == 'done' and coord . get_count ( call ) >= 4 : state . save_state ( call , state . states [ 'TRANSIT' ] ) ans = coord . polygon_create ( call , coord . get_poly_points ( call ) . split ( ',' ) ) markup . add ( telebot . types . InlineKeyboardButton ( 'Yes' , callback_data = 'yes' ) , telebot . types . InlineKeyboardButton ( 'No' , callback_data = 'no' ) ) bot . send_message ( call . message . chat . id , ans , parse_mode = 'HTML' , reply_markup = markup ) elif call . data == 'done' and coord . get_count ( call ) < 4 : ans = answers [ 'VERTICES' ] % coord . get_count ( call ) bot . send_message ( call . message . chat . id , ans , parse_mode = 'HTML' )
If the bot state for a message/call sender is POLYGON.
If the bot state for a message / call sender is POLYGON .
"""If the bot state for a message/call sender is POLYGON.

       if call.data is 'done' and the number of vertices >= 4,
       switch to the TRANSIT state, create a POLYGON geometry
       in the features table, send the assigned answer and the
       'Yes, No' markup

       elif call.data is done and the number of vertices < 4,
       send the assigned answer."""
call