def configured_reply(self):
 try:
  msg = self.msgList.get(timeout=1)
 except Queue.Empty:
  pass
 else:
  if (msg['FromUserName'] == self.storageClass.userName):
   actualOpposite = msg['ToUserName']
  else:
   actualOpposite = msg['FromUserName']
  if ('@@' in actualOpposite):
   replyFn = self.functionDict['GroupChat'].get(msg['Type'])
  elif self.search_mps(userName=msg['FromUserName']):
   replyFn = self.functionDict['MpChat'].get(msg['Type'])
  elif (('@' in actualOpposite) or (actualOpposite in ('filehelper', 'fmessage'))):
   replyFn = self.functionDict['FriendChat'].get(msg['Type'])
  else:
   replyFn = self.functionDict['MpChat'].get(msg['Type'])
  if (replyFn is None):
   r = None
  else:
   try:
    r = replyFn(msg)
    if (r is not None):
     self.send(r, msg.get('FromUserName'))
   except:
    logger.warning('An error occurred in registered function, use `itchat.run(debug=True)` to show detailed information')
    logger.debug(traceback.format_exc())

def configured_reply ( self ) : try : msg = self . msgList . get ( timeout = 1 ) except Queue . Empty : pass else : if ( msg [ 'FromUserName' ] == self . storageClass . userName ) : actualOpposite = msg [ 'ToUserName' ] else : actualOpposite = msg [ 'FromUserName' ] if ( '@@' in actualOpposite ) : replyFn = self . functionDict [ 'GroupChat' ] . get ( msg [ 'Type' ] ) elif self . search_mps ( userName = msg [ 'FromUserName' ] ) : replyFn = self . functionDict [ 'MpChat' ] . get ( msg [ 'Type' ] ) elif ( ( '@' in actualOpposite ) or ( actualOpposite in ( 'filehelper' , 'fmessage' ) ) ) : replyFn = self . functionDict [ 'FriendChat' ] . get ( msg [ 'Type' ] ) else : replyFn = self . functionDict [ 'MpChat' ] . get ( msg [ 'Type' ] ) if ( replyFn is None ) : r = None else : try : r = replyFn ( msg ) if ( r is not None ) : self . send ( r , msg . get ( 'FromUserName' ) ) except : logger . warning ( 'An error occurred in registered function, use `itchat.run(debug=True)` to show detailed information' ) logger . debug ( traceback . format_exc ( ) )
determine the type of message and reply if its method is defined however .