pengrad / java-telegram-bot-api

Telegram Bot API for Java
https://core.telegram.org/bots
Apache License 2.0
1.81k stars 374 forks source link

Type KeyboardButton #23

Closed romkaqua closed 8 years ago

romkaqua commented 8 years ago

Hello! I need to send field "request_location" in object "KeyboardButton". How i can do that? Thank you.

pengrad commented 8 years ago

Hi! I will add Bot API 2.0 support in next release. Thanks!

drecchia commented 8 years ago

Please, have a look in my fork, I have implement some 2.0 features. https://github.com/drecchia/java-telegram-bot-api

Ex:

Keyboard kb = new InlineKeyboardMarkup(new InlineKeyboardButton[]{new InlineKeyboardButton("AAA0001", null, "AAA0001", null)});
        bot.sendMessage( message.chat().id(), "Inline button test:", ParseMode.Markdown, false, null, kb );

I will submit a pull request. Thanks

pengrad commented 8 years ago

Added in 2.0.0

Keyboard keyboard = new ReplyKeyboardMarkup(
        new KeyboardButton[]{
                new KeyboardButton("text"),
                new KeyboardButton("contact").requestContact(true),
                new KeyboardButton("location").requestLocation(true)
        }
);