code: def register_listener_handle(wxbot):
      
      from wxpy import TEXT
  
      @wxbot.bot.register(wxbot.default_receiver, TEXT, except_self=False)
      def sender_command_handle(msg):
          command_dict = {MESSAGE_REPORT_COMMAND: timeout_message_report(),
                          MESSAGE_STATUS_COMMAND: generate_run_info()}
          message = command_dict.get(msg.text, None)
          if message:
              return message
          myself = wxbot.bot.registered.get_config(msg)
          registered_copy = copy.copy(wxbot.bot.registered)
          registered_copy.remove(myself)
          pre_conf = registered_copy.get_config(msg)
          if pre_conf:
              my_name = sys._getframe().f_code.co_name
              if my_name != pre_conf.func.__name__:
                  pre_conf.func(msg)
docs: wechat_sender 向 wxpy 注册控制消息 handler