MQTT Subscribe unable reading value after put in telegram code.

#include <WiFi.h>
#include <PubSubClient.h>
#include <UniversalTelegramBot.h>
const char* ssid = "";
const char* password =  "";
const char* mqttServer = "test.mosquitto.org";
const int mqttPort = 1883;
// ------- Telegram config ----------
#define BOT_TOKEN "693031724:AAGqHc0pQk_d3dIbRDrZAtqqJRF5EXCckVE"  // your Bot Token (Get from Botfather)
#define CHAT_ID "" // Chat ID of where you want the message to go (You can use MyIdBot to get the chat ID)
long Bot_lasttime;
int Distance = 0;
int bulk_messages_mtbs = 10000; // testing to delay 6sec to detecting another distance and which message been sent .
WiFiClient espClient;
PubSubClient client(espClient);

UniversalTelegramBot bot(BOT_TOKEN, espClient);

String ipAddress = "";

volatile bool telegramButton1PressedFlag = false;
volatile bool telegramButton2PressedFlag = false;

void callback(char* topic, byte* payload, unsigned int length) {
 
  Serial.print("Message arrived in topic: ");
  Serial.println(topic);
 
  Serial.println("Message:");
  for (int i = 0; i < length; i++) {
    Serial.print((char)payload[i]);
  }
 
  Serial.println();
  Serial.println("-----------------------");
 
}
 
void setup() {
 
  Serial.begin(115200);
 
  WiFi.begin(ssid, password);
 
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.println("Connecting to WiFi..");
  }
  Serial.println("Connected to the WiFi network");
 
  client.setServer(mqttServer, mqttPort);
  client.setCallback(callback);
 
  while (!client.connected()) {
    Serial.println("Connecting to MQTT...");
 
    if (client.connect("ESP32Client")) {
 
      Serial.println("connected Server");  
 
    } else {
 
      Serial.print("failed with state ");
      Serial.print(client.state());
      delay(2000);
 
    }
  }
 
  client.subscribe("smartdevice");
}
  void telegramButton1Pressed() {                                 //Empited
  Serial.println("Telegram Button-1 Pressed");
       if(Distance>80) {
  {
       telegramButton1PressedFlag = true;
  }
  return;
}
}
  void sendTelegramMessage() {
    String message = "NO toilet paper @ testing now ";              
    if(bot.sendMessage(CHAT_ID, message, "Markdown")){
      Serial.println("TELEGRAM Message 1 Successfully sent");
  }
      telegramButton1PressedFlag = false;
}

  void telegramButton2Pressed() {                                 //Full
    Serial.println("Telegram Button-2 Pressed");
         if(Distance<30) {
  {
         telegramButton2PressedFlag = true;
  }
    return;
}
}
  void sendTelegramMessage2() {
    String message2 = "New toilet paper roll was loaded @ testing now";              
    if(bot.sendMessage(CHAT_ID, message2, "Markdown")){
      Serial.println("TELEGRAM Message 2 Successfully sent");
  }
      telegramButton2PressedFlag = false;
}
void loop() {
  client.loop();
  if(Distance>80) {
      sendTelegramMessage();
      delay(bulk_messages_mtbs);
      Bot_lasttime = 0;
} else if(Distance<30) {
           sendTelegramMessage();
           delay(bulk_messages_mtbs);
           Bot_lasttime = 0;
}
  
}

can any one help me to see whats wrongs with my subscribe code? after i added in the telegram coding the coding become cannot reading any of the message(“distance”) from the mqtt server channel . i am using esp32.