def message():
 t = Twitter(auth=authen())
 try:
  user = g['stuff'].split()[0]
  if user[0].startswith('@'):
   content = ' '.join(g['stuff'].split()[1:])
   t.direct_messages.new(screen_name=user[1:], text=content)
   printNicely(green('Message sent.'))
  else:
   printNicely(red("A name should begin with a '@'"))
 except:
  debug_option()
  printNicely(red("Sorry I can't understand."))

def message ( ) : t = Twitter ( auth = authen ( ) ) try : user = g [ 'stuff' ] . split ( ) [ 0 ] if user [ 0 ] . startswith ( '@' ) : content = ' ' . join ( g [ 'stuff' ] . split ( ) [ 1 : ] ) t . direct_messages . new ( screen_name = user [ 1 : ] , text = content ) printNicely ( green ( 'Message sent.' ) ) else : printNicely ( red ( "A name should begin with a '@'" ) ) except : debug_option ( ) printNicely ( red ( "Sorry I can't understand." ) )
event handler for a room receiving a message .