Skip to content
This repository was archived by the owner on Jan 12, 2021. It is now read-only.

reefstah/TelegramBotAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

76 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TelegramBotAPI Build Status

The Java 8 implementation of Telegram's bot API.

Example bot

public class AwesomoBot {

    private static final String TOKEN = "YourTokenHere";
    private static final TelegramBot bot = TelegramBot.getInstance(TOKEN);

    public static void main(String[] args) throws IOException {
        new AwesomoBot().replyWithAwesomeness();
    }

    public AwesomoBot replyWithAwesomeness() throws IOException {
        List<Update> updates = bot.getUpdates();
        updates.forEach(update -> {
            try {
                bot.sendMessage(update.getMessage().getChat().getId(), "You are awesum.");
            } catch (IOException e) {
                e.printStackTrace();
            }
        });
        return this;
    }
}

Or try the fluent API

SendMessage
        .to(YourChatIdHere)
        .withText("Sexy fluent TelegramBotAPI.")
        .fromBot(YourBotTokenHere);

About

A Java 8 implementation of Telegram's bot API.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages