title: Telegram app to remove multiple words from input message
body: <p>I'm trying to create a small app that reads a chat message and echoes a filtered text</p>
  <p>I need it to take this message:</p>
  <p>INPUT:</p>
  <pre><code>#notthis/remove
  
  remove this line
  
  This one too
  </code></pre>
  <p>Output:</p>
  <pre><code>notthis
  </code></pre>
  <p>At the moment all it does is remove the second word + the first hashtag:</p>
  <p><code>&quot;hello#hello&quot;</code> which becomes  <code>hello</code></p>
  <p>I tried adding the <code>/</code> like this <code>input.split(&quot;#&quot;,&quot;/&quot;);</code> but all it does is crash the program.</p>
  <p>Not asking to do the program for me, but I'd really appreciate any hints.
  Thank you!</p>
  <pre><code>const Telegraf = require('telegraf');
  
  const bot = new Telegraf('182049');
  
  const helpMessage = `
  Say something to me
  /start - start the bot
  /help - command reference
  `;
  
  bot.start((ctx) =&gt; {
      ctx.reply(&quot;Hi I am echoo bot&quot;);
      ctx.reply(helpMessage);
  });
  
  bot.help((ctx) =&gt; {
      ctx.reply(helpMessage)
  });
  
  
  bot.on(&quot;text&quot;, (ctx) =&gt; {
      let input = ctx.message.text;
      let inputArray = input.split(&quot;#&quot;);
  
      console.log(inputArray);
      
      let message = &quot;&quot;;
  
      if (inputArray.length == 1) {
          message = &quot;no separator&quot;;
      } else {
          inputArray.shift();
          message = inputArray.join(&quot; &quot;);
      }
      
      ctx.reply(message);
  });
  
  
  bot.launch()
  </code></pre>