#NEWLINE# def handle_message( event , server ) : #NEWLINE# #INDENT# subtype = event . get ( 'subtype' , '' ) #NEWLINE# if ( subtype == 'message_changed' ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# if ( subtype == 'bot_message' ) : #NEWLINE# #INDENT# return handle_bot_message ( event , server ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# msguser = server . slack . server . users [ event [ 'user' ] ] #NEWLINE# #UNINDENT# except KeyError : #NEWLINE# #INDENT# logger . debug ( 'event {0} has no user' . format ( event ) ) #NEWLINE# return #NEWLINE# #UNINDENT# return '\n' . join ( run_hook ( event . hooks , 'message' , event , server ) )