title: How to make TelegramBot work constantly, without manually starting my Java-program all the time?
body: <p>I am novice and I have written the code of my TelegramBot in Eclipse. It works fine, but I would like to know how can i make it work constantly without me launching the <strong>Java-application</strong>. I guess I should use server for this. Thanks</p>
  
  <p><strong>Edit</strong>: Added the Java code</p>
  
  <pre><code>import java.time.LocalDateTime;
  import org.telegram.telegrambots.api.methods.send.SendMessage;
  import org.telegram.telegrambots.api.objects.Update;
  import org.telegram.telegrambots.bots.TelegramLongPollingBot;
  import org.telegram.telegrambots.exceptions.TelegramApiException;
  
  public class MyFirstBot  extends TelegramLongPollingBot{
  
      @Override
      public String getBotUsername() {
          // TODO Auto-generated method stub
          return "TheBot Version0.01";
      }
  
      @Override
      public void onUpdateReceived(Update update) {
          // TODO Auto-generated method stub
           SendMessage message = new SendMessage()
                      .setChatId(update.getMessage().getChatId());
           if(update.hasMessage() &amp;&amp; update.getMessage().isCommand()){
               try{
                   switch(update.getMessage().getText()){ //reads command
                   case("/hello"):
                      message.setText("Hi there!"); 
                      sendMessage(message); //says hello
                      break;
                   case("/date"):
                      message.setText(LocalDateTime.now().toString());
                      sendMessage(message); //tells time and date
                      break;  
                   default:
                      message.setText("Invalid Value");
                      sendMessage(message);} //in case no such command exists
               }
               catch(TelegramApiException e){
                   e.printStackTrace();
               }
           }          
      }
  
      @Override
      public String getBotToken() {
          // TODO Auto-generated method stub
          return "xxx";
      }
  
  }
  </code></pre>