title: Bad Request: can't parse entities: Can't find end of the entity starting at byte offset 3589 ( in bot telegram api ) JavaScript
body: <p>Hello and do not be tired.</p>
  <p>My friends, I want to send a few messages in the telegram using a bot, but when I set parse_mode equal to Markdown, the first message is sent correctly, but for the second message, it gives a bad request.</p>
  <p>I do not want to use HTML</p>
  <p>The messages I send are written in such a code that it sends once every 50 characters, and if it reaches the end and it is less than 50, it should send as many as it could.</p>
  <p>And I have 89 characters that can send 50 easily, but they can not send the next 39 and get objections</p>
  <p>My code is in JavaScript</p>
  <p>Thank you if you can help</p>
  <p>(Meanwhile, these 89 characters do not differ from each other, they only interact in numerical value)</p>
  <p>Thank you if you can help me</p>
  <p>My code:</p>
  <p>`</p>
  <pre><code>var len = 50;
  
  if(key2 == &quot;run? (I Money Bot)&quot; || key2 == &quot;time&quot; || key2 == &quot;run? (Title)&quot;){
          } else {
            let getbody = sessionStorage.getItem(&quot;all&quot;);
            sessionStorage.setItem(&quot;all&quot;, getget + &quot;#&quot; + &quot;[&quot;+key2+&quot;] 
  (https://t.me/joinchat/BZK0xRV8unyYfBmgQHnGUw) : &quot; + Separate(&quot; *&quot;+value2+&quot;* &quot;) + &quot; تومان&quot;) ; 
          if (i == sessionStorage.length-1){
              let body = sessionStorage.getItem(&quot;all&quot;).replace(/#/gi,&quot;%0A%0A&quot;);
              console.log(&quot;all ==&gt; &quot;+sessionStorage.length);
              sessionStorage.removeItem(&quot;all&quot;);
              Bot(body + &quot;%0A%0A╔══════════╗%0A @Puzzle_Bours_Gp](https://t.me/joinchat/BZK0xRV8unyYfBmgQHnGUw)%0A╚══════════╝%0A%0A&quot; +
              &quot;[Time : ](https://t.me/joinchat/BZK0xRV8unyYfBmgQHnGUw) : &quot; + hou + &quot;:&quot; + min + &quot;:&quot; + sec);
              console.log(&quot;finish&quot;);
          }else if(i == len){
              let body = sessionStorage.getItem(&quot;all&quot;).replace(/#/gi,&quot;%0A%0A&quot;);
              sessionStorage.removeItem(&quot;all&quot;);
              // console.log(sessionStorage.getItem(&quot;all&quot;).length);
              Bot(body + &quot;%0A%0A╔══════════╗%0A [@Puzzle_Bours_Gp](https://t.me/joinchat/BZK0xRV8unyYfBmgQHnGUw)%0A╚══════════╝%0A%0A&quot; +
              &quot;[Time : ](https://t.me/joinchat/BZK0xRV8unyYfBmgQHnGUw) : &quot; + hou + &quot;:&quot; + min + &quot;:&quot; + sec);
              len = len + 50;
              console.log(&quot;send characters&quot;);
          }
  }
  </code></pre>
  <p>`</p>
  <p>Bot() is the function for send text to bot in telegram.
  I use %0A instead of \n because I set parse_mode to MarkDown.</p>