#NEWLINE# def handle( self , bot , update , **kwargs ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# ctx = self . get_context ( bot , update , ** kwargs ) #NEWLINE# text = TextResponse ( self . template_text , ctx ) . render ( ) #NEWLINE# keyboard = KeyboardResponse ( self . template_keyboard , ctx ) . render ( ) #NEWLINE# if text : #NEWLINE# #INDENT# bot . send_message ( chat_id = update . message . chat_id , text = text . encode ( 'utf-8' ) , reply_markup = keyboard , parse_mode = ParseMode . MARKDOWN ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# logger . info ( ( 'No text response for update %s' % str ( update ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# except : #NEWLINE# #INDENT# exc_info = sys . exc_info ( ) #NEWLINE# traceback . print_exception ( * exc_info ) #NEWLINE# raise