Telegram Bots Utilities – examples: send a photo

Send a Photo

This is a simple example on how to send a photo.

public static void main(String[] args) throws GettingUpdatesException, IOException {
    String yourToken = "YOUR TOKEN";
    TelegramBot b = new TelegramBot(yourToken);
    b.sendPhoto("chat_id", new File("path"), "caption", false, 0, null);
}

If you want to see an exciting example on how to use it just give a look to This post!

Previous Entries Telegram Bot Utilities - examples: Receive updates Next Entries Telegram Bots Utilities - examples: custom keyboard

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.