Trying to host my telegram bot

Hello,

Recently I found a library that communicates with telegram bot, using esp8266 module.

I compiled and flashed this code to my esp8266:

#include "arduino_secrets.h"
#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>
#include <TelegramBot.h>

// Initialize Wifi connection to the router
const char* ssid  = SECRET_SSID;
const char* password = SECRET_PASS;


// Initialize Telegram BOT
const char BotToken[] = SECRET_BOT_TOKEN;

WiFiClientSecure net_ssl;
TelegramBot bot (BotToken, net_ssl);


void setup() {

  Serial.begin(115200);
  while (!Serial); // Wait for the Serial monitor to be opened

  // attempt to connect to Wifi network:
  Serial.print("Connecting Wifi: ");
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println("");
  Serial.println("WiFi connected");


  bot.begin();

}

void loop() {
 
    message m = bot.getUpdates(); // Read new messages
    if ( m.chat_id != 0 ){ // Checks if there are some updates
      Serial.println(m.text);
      bot.sendMessage(m.chat_id, m.text);  // Reply to the same chat with the same text
    } else {
      Serial.println("no new message");
    }

}

with the following options:

Upload Speed : 115200
CPU Freq : 160 MHz
Flash Size : 4M (NO SPIFFS)

and I'm using the following versions of libraries:

ESP8266 Core : 2.5.0
ESP8266WiFi : 1.0
TelegramBot-Library-master : 1.2.5
ArduinoJson : 5.13.5

on Windows 10 Arduino IDE and have attached my esp8266 via USB serial port.

The issue is when I open the Serial Monitor with 115200 baud rate, it gives me the following error where I can't understand:

.....
WiFi connected
no new message

Exception (28):
epc1=0x40213a06 epc2=0x00000000 epc3=0x00000000 excvaddr=0x045403c7 depc=0x00000000

>>>stack>>>

ctx: sys
sp: 3fffed60 end: 3fffffb0 offset: 01a0
3fffef00:  00000001 00000000 3fff1694 4020fe84  
3fffef10:  3ffecb30 40100e11 00000000 40243e02  
3fffef20:  4023f02d 3fffdab0 00000042 4023f0ec  
3fffef30:  3ffecb30 4023ea0a 3fffdab0 00000000  
3fffef40:  3fffdcc0 3ffe94b0 00000001 00000000  
3fffef50:  3ffe94b0 40000f49 3fffdab0 40000f49  
3fffef60:  40000e19 40001878 00000002 00000000  
3fffef70:  3fffff10 aa55aa55 000000fd 40104750  
3fffef80:  40104756 00000002 00000000 5e6ab6ba  
3fffef90:  4010000d d05dfd81 93bb2795 3350c7fd  
3fffefa0:  401009e0 3fffef3c 4010098d 3ffff9f8  
3fffefb0:  3fffffc0 00000000 00000000 feefeffe  
3fffefc0:  feefeffe feefeffe feefeffe feefeffe  
3fffefd0:  feefeffe feefeffe feefeffe feefeffe  
3fffefe0:  feefeffe feefeffe feefeffe feefeffe  
3fffeff0:  feefeffe feefeffe feefeffe feefeffe  
3ffff000:  feefeffe feefeffe feefeffe feefeffe  
3ffff010:  feefeffe feefeffe feefeffe feefeffe  
3ffff020:  feefeffe feefeffe feefeffe feefeffe  
3ffff030:  feefeffe feefeffe feefeffe feefeffe  
3ffff040:  feefeffe feefeffe feefeffe feefeffe  
3ffff050:  feefeffe feefeffe feefeffe feefeffe  
3ffff060:  feefeffe feefeffe feefeffe feefeffe  
3ffff070:  feefeffe feefeffe feefeffe feefeffe  
3ffff080:  feefeffe feefeffe feefeffe feefeffe  
3ffff090:  feefeffe feefeffe feefeffe feefeffe  
3ffff0a0:  feefeffe feefeffe feefeffe feefeffe  
3ffff0b0:  feefeffe feefeffe feefeffe feefeffe  
3ffff0c0:  feefeffe feefeffe feefeffe feefeffe  
3ffff0d0:  feefeffe feefeffe feefeffe feefeffe  
3ffff0e0:  feefeffe feefeffe feefeffe feefeffe  
3ffff0f0:  feefeffe feefeffe feefeffe feefeffe  
3ffff100:  feefeffe feefeffe feefeffe feefeffe  
3ffff110:  feefeffe feefeffe feefeffe feefeffe  
3ffff120:  feefeffe feefeffe feefeffe feefeffe  
3ffff130:  feefeffe feefeffe feefeffe feefeffe  
3ffff140:  feefeffe feefeffe feefeffe feefeffe  
3ffff150:  feefeffe feefeffe feefeffe feefeffe  
3ffff160:  6ff73433 971bf663 b8f7538a 47f039ca  
3ffff170:  c0b15636 a3a551ac c14dced7 7ae1be01  
3ffff180:  5c5c5c5c 5c5c5c5c 5c5c5c5c 5c5c5c5c  
3ffff190:  5c5c5c5c 5c5c5c5c 5c5c5c5c 5c5c5c5c  
3ffff1a0:  9a5bf027 6fb8b05c 2d88cf36 12a5e273  
3ffff1b0:  b4dd2c57 1193c29a b35ff0f5 527c0057  
3ffff1c0:  7681e914 ae3f2c27 dcdb78dd 291a59ea  
3ffff1d0:  e556a642 1ba288ad daccfc7f 889a3ae9  
3ffff1e0:  c3613dd3 00c78023 acf39dd6 1afa4d35  
3ffff1f0:  54b24fb6 5ccb7cf2 4f31a4cf 4445b89d  
3ffff200:  efc95ba1 4494949d c580f425 87899a6e  
3ffff210:  b02b402f 6b4c45f9 e786bc89 62479e47  
3ffff220:  539d8a00 33674ce6 5a4ceec9 5e5519a2  
3ffff230:  80000000 00000000 00000000 00000000  
3ffff240:  00000000 00000000 00000000 00000300  
3ffff250:  9eec8b16 0d49e902 21728877 943e5271  
3ffff260:  820e5e11 b90a9689 4856032c 27fd6db9  
3ffff270:  4f2ba1a3 3cd4d0d1 39345709 00000080  
3ffff280:  03030000 010000d4 a7d97c5e 000036ec  

(this continues like this until my post exceeds 9000 characters)
<<<stack<<<

 ets Jan  8 2013,rst cause:2, boot mode:(3,7)

load 0x4010f000, len 1384, room 16 
tail 8
chksum 0x2d
csum 0x2d
v951aeffa
~ld
Connecting Wifi: .
WiFi connected

Can someone help me solve this error? Any help would be appreciated.

try to put a delay like 100 milliseconds in the loop i guess that it is not very good to check so often
the error you see seems to be fragmentation heap in the esp