rubenlagus / TelegramBots

Java library to create bots using Telegram Bots API
https://telegram.me/JavaBotsApi
MIT License
4.78k stars 1.22k forks source link

How can i send a KeyBoardButton object? #278

Closed Pie133 closed 7 years ago

Pie133 commented 7 years ago

how can i send this object to my client?

KeyboardButton keyboardButton = new KeyboardButton(); keyboardButton.setRequestContact(true); keyboardButton.setText("Send your number");

Clevero commented 7 years ago

Did you read the wiki?

https://github.com/rubenlagus/TelegramBots/wiki/FAQ#how_to_use_custom_keyboards

and also this example bot in MonsterDevelopers book (also referenced in the wiki) uses custom keyboards https://monsterdeveloper.gitbooks.io/writing-telegram-bots-on-java/content/lesson-2.-photobot.html

Pie133 commented 7 years ago

But i cant add a KeyboardButton object to a KeyboardRow i need to use keyboardbutton object because i need to ask for client number Can you just give me an example to how send a button that request client number? sorry for my bad english

Clevero commented 7 years ago

Why you cannot add a KeyboardButton to a KeyboardRow?

Clevero commented 7 years ago

@Pie133 is your problem solved?

Clevero commented 7 years ago

@rubenlagus I think this issue can be closed due to inactivity

vse-prosto commented 3 years ago

Аналогичный вопрос

$data['reply_markup'] = (new Keyboard( (new KeyboardButton('Share Contact'))->setRequestContact(true) )) Не работает