title: How to send local photo in telegram bot for java
body: <p>I have a task: 
  Need sending a photo with my local folder in telegram bot.</p>
  
  <p>Precondition:</p>
  
  <p>I use this library <a href="https://github.com/rubenlagus/TelegramBots" rel="nofollow noreferrer">https://github.com/rubenlagus/TelegramBots</a></p>
  
  <p>In Pom file: </p>
  
  <pre><code> &lt;repositories&gt;
      &lt;repository&gt;
          &lt;id&gt;jitpack.io&lt;/id&gt;
          &lt;url&gt;https://jitpack.io&lt;/url&gt;
      &lt;/repository&gt;
  &lt;/repositories&gt;
  
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.github.rubenlagus&lt;/groupId&gt;
          &lt;artifactId&gt;TelegramBots&lt;/artifactId&gt;
          &lt;version&gt;4.1&lt;/version&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>How to create Send Method?</p>
  
  <p>I tried to do so:</p>
  
  <pre><code>public void sendInTelegram() {
      try {
          TelegramLongPollingBot telegramLongPollingBot = new TelegramLongPollingBot() {
              @Override
              public String getBotToken() {
                  return "My_Token";
              }
  
              @Override
              public void onUpdateReceived(Update update) {
                  try {
                      SendPhoto message = new SendPhoto().setPhoto("SomeText", new FileInputStream(new File("/root/index.png")));
                      this.sendPhoto(message);
  
                  } catch (FileNotFoundException e) {
                      e.printStackTrace();
                  }
              }
  
              @Override
              public String getBotUsername() {
                  return "my_bot";
              }
          };
      } catch (Exception e) {
          logger.error("Send in Telegram fail");
          Assert.fail("Send in Telegram fail");
      }
  </code></pre>
  
  <p>but his.sendPhoto(message); sendPhoto is unresolved 
  <a href="https://i.stack.imgur.com/nWb0q.png" rel="nofollow noreferrer">enter image description here</a></p>
  
  <p>Please tell me what is not enough that I could send a photo?</p>