title: Heroku Chatbot App fails to send message to Dialogflow
body: <p>Interestingly, my Heroku Chatbot (NodeJS) App was working finally for a week. After that, something happened and no message goes through to Dialogflow anymore.</p>
  
  <p>The Heroku NodeJS error message is:</p>
  
  <blockquote>
    <p>2019-11-25T17:09:09.308553+00:00 app[web.1]: error sending message to dialogflow!
    2019-11-25T17:09:09.308843+00:00 app[web.1]: TypeError: Cannot read property 'charCodeAt' of undefined</p>
  </blockquote>
  
  <p>The code is:</p>
  
  <pre><code>async function sendToDialogFlow(sender, textString, params) {
      sendTypingOn(sender);
      try {
          const sessionPath = sessionClient.sessionPath(
              config.GOOGLE_PROJECT_ID,
              sessionIds.get(sender)
          );
  
          const request = {
              session: sessionPath,
              queryInput: {
                  text: {
                      text: textString,
                      languageCode: config.DF_LANGUAGE_CODE,
                  },
              },
              queryParams: {
                  payload: {
                      data: params
                  }
              }
          };
          const responses = await sessionClient.detectIntent(request);
          const result = responses[0].queryResult;
          handleDialogFlowResponse(sender, result);
      } catch (e) {
          console.log(' error sending message to dialogflow! ');
          console.log(e);
      }
  
  }
  </code></pre>
  
  <p>I can attach any additional info on request. </p>
  
  <p>Please someone try to help me</p>
  
  <p>Thank you!</p>