bot.py
def video_handler(message):
    """If the message content type is video.

       if the bot state for a message/call sender is MEDIA1, try to get
       the url of a video, switch to the MEDIA2 state, save the url,
       send the assigned answer and the 'Yes, No' markup.

       pass in the case of the psycopg2.ProgrammingError exception """
    ans = answers['VIDEO_NS']
    markup = telebot.types.InlineKeyboardMarkup()

    try:
        if state.show_state(message) == state.states['MEDIA1']:
            path = media.media_path(token, bot.get_file(message.video.file_id), 'video/mp4')
            state.save_state(message, state.states['MEDIA2'])
            ans = media.save_media(message, path, 'video')
            markup.add(telebot.types.InlineKeyboardButton('Yes', callback_data='yes'),
                       telebot.types.InlineKeyboardButton('No', callback_data='no'))
    except psycopg2.ProgrammingError:
        pass

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

       if the bot state for a message/call sender is MEDIA1, try to get
       the url of a video, switch to the MEDIA2 state, save the url,
       send the assigned answer and the 'Yes, No' markup.

       pass in the case of the psycopg2.ProgrammingError exception 
If the message content type is video.
if the bot state for a message/call sender is MEDIA1, try to get
the url of a video, switch to the MEDIA2 state, save the url,
send the assigned answer and the 'Yes, No' markup.

pass in the case of the psycopg2.ProgrammingError exception
If the message content type is video . if the bot state for a message / call sender is MEDIA1 try to get the url of a video switch to the MEDIA2 state save the url send the assigned answer and the ' Yes No ' markup . pass in the case of the psycopg2 . ProgrammingError exception
def video_handler(message):
    ans = answers['VIDEO_NS']
    markup = telebot.types.InlineKeyboardMarkup()
    try:
        if state.show_state(message) == state.states['MEDIA1']:
            path = media.media_path(token, bot.get_file(message.video.file_id), 'video/mp4')
            state.save_state(message, state.states['MEDIA2'])
            ans = media.save_media(message, path, 'video')
            markup.add(telebot.types.InlineKeyboardButton('Yes', callback_data='yes'),
                       telebot.types.InlineKeyboardButton('No', callback_data='no'))
    except psycopg2.ProgrammingError:
        pass
    bot.send_message(message.chat.id, ans, parse_mode='HTML', reply_markup=markup)
def video_handler ( message ) : ans = answers [ 'VIDEO_NS' ] markup = telebot . types . InlineKeyboardMarkup ( ) try : if state . show_state ( message ) == state . states [ 'MEDIA1' ] : path = media . media_path ( token , bot . get_file ( message . video . file_id ) , 'video/mp4' ) state . save_state ( message , state . states [ 'MEDIA2' ] ) ans = media . save_media ( message , path , 'video' ) markup . add ( telebot . types . InlineKeyboardButton ( 'Yes' , callback_data = 'yes' ) , telebot . types . InlineKeyboardButton ( 'No' , callback_data = 'no' ) ) except psycopg2 . ProgrammingError : pass bot . send_message ( message . chat . id , ans , parse_mode = 'HTML' , reply_markup = markup )
If the message content type is video.
If the message content type is video .
"""If the message content type is video.

       if the bot state for a message/call sender is MEDIA1, try to get
       the url of a video, switch to the MEDIA2 state, save the url,
       send the assigned answer and the 'Yes, No' markup.

       pass in the case of the psycopg2.ProgrammingError exception """
message