title: Can't get /scam to make my telegram bot respond in google apps script
body: <p>I'm trying to make a bot using google apps script for my telegram group to record scam contracts to google sheets. I can't get the /scam 0xtest00000000 to make the bot respond, or record it to my google sheets. I can do it with /^@/ and it works fine, but I want to use common style tg bot commands. I've tried putting in text = &quot;&quot;, I've tried slicing, I've tried all sorts of things. Any help would be appreciated.</p>
  <pre><code>    function getMe() {
      var response = UrlFetchApp.fetch(url + &quot;/getMe&quot;);
      Logger.log(response.getContentText());
  }
  
  
  function setWebhook() {
    var response = UrlFetchApp.fetch(url + &quot;/setWebhook?url=&quot; + 
    webAppUrl);
    Logger.log(response.getContentText());
  
  }
  
  function sendText(chat_id, text) {
    let data = {
      method: &quot;post&quot;,
      payload: {
        method: &quot;sendMessage&quot;,
        chat_id: String(chat_id),
        text: text,
        parse_mode: &quot;HTML&quot;
      }    
    };
    UrlFetchApp.fetch(url + &quot;/sendMessage?chat_id=&quot; + chat_id + &quot;$texts&quot; 
   + encodeURIComponent(text));
  }
  
  function doGet(e) {
    return HtmlService.createHtmlOutput (&quot;Hello&quot; + JSON.stringify(e));
  }
  
  
  function doPost(e) {
    try {
    let contents = JSON.parse(e.postData.contents);
    GmailApp.sendEmail(Session.getEffectiveUser().getEmail(), &quot;Telegram 
    Bot Update&quot;,JSON.stringify(contents,null,4));
    let text = contents.message.text;
    let chat_id = contents.message.chat.id;
    let name = contents.message.from.first_name + &quot; &quot; + 
    contents.message.from.last_name;
    let user_id = contents.message.from.id;
    let username = contents.message.from.username;
    let contract = text.slice(1).split(&quot; &quot;)[0];
   // let item = text.split(&quot; &quot;);
    let scam = &quot;/scam&quot;;
    // let com1 = scam.split(' ')[0];
  
    if(text == scam)) {
    
    SpreadsheetApp.openById(ssid).appendRow([new 
  Date(),user_id,username,name,contract]);
    sendText(chat_id, &quot;Contract address &quot; + contract + &quot; has been added 
   to the list.&quot; );
    }
  
  } catch(e) {
    sendText(lbsId,&quot;Error&quot; + JSON.stringify(e,null,4));
  }
  }
  </code></pre>