#NEWLINE# def post_message( self , group_identifier , text ) : #NEWLINE# #INDENT# if group_identifier . startswith ( '#' ) : #NEWLINE# #INDENT# groups = [ group for group in self . data [ 'groups' ] . values ( ) if ( text [ 'name' ] == group_identifier . strip ( '#' ) ) ] #NEWLINE# group_identifier = groups [ 0 ] [ 'id' ] #NEWLINE# #UNINDENT# self . _validate_group ( group_id = group_identifier ) #NEWLINE# self . data [ 'groups' ] [ group_identifier ] [ 'messages' ] . append ( text )