Skip to content

Latest commit

 

History

History
38 lines (29 loc) · 846 Bytes

File metadata and controls

38 lines (29 loc) · 846 Bytes

java-telegram-bot-api

Simple Java API for Telegram Bots

Download

Download the latest version via Gradle:

compile 'com.github.pengrad:java-telegram-bot-api:1.2.0'

or Maven:

<dependency>
  <groupId>com.github.pengrad</groupId>
  <artifactId>java-telegram-bot-api</artifactId>
  <version>1.2.0</version>
</dependency>

Usage

TelegramBot bot = TelegramBotAdapter.build("BOT_TOKEN");

bot.sendMessage(
    123321,                    // chat_id
    "Hello _italic_ *bold*!",  // text
    ParseMode.Markdown,        // Markdown text or null
    false,                     // disable_web_page_preview
    replyMessageId,            // reply_to_message_id
    new ReplyKeyboardMarkup(new String[]{"ok", "test"}).oneTimeKeyboard(true));  // keyboard