#NEWLINE# def on_message( msg , server ) : #NEWLINE# #INDENT# text = msg . get ( 'text' , '' ) #NEWLINE# match = re . findall ( '!youtube (.*)' , text ) #NEWLINE# if ( not msg ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# searchterm = match [ 0 ] #NEWLINE# return youtube ( searchterm . encode ( 'utf8' ) )