Вот мой метод:
public void setButtons(SendMessage sendMessage) {
ReplyKeyboardMarkup replyKeyboardMarkup = new ReplyKeyboardMarkup();
KeyboardButton keyboardButton = new KeyboardButton("Send number phone");
KeyboardButton keyboardButton1 = new KeyboardButton("Send location");
Message message = new Message();
List keyboardRowList = new ArrayList<>();
KeyboardRow keyboardFirstRow = new KeyboardRow();
keyboardFirstRow.add(keyboardButton);
keyboardFirstRow.add(keyboardButton1);
public void setButtons(SendMessage sendMessage) {
ReplyKeyboardMarkup replyKeyboardMarkup = new ReplyKeyboardMarkup();
KeyboardButton keyboardButton = new KeyboardButton("Send number phone");
KeyboardButton keyboardButton1 = new KeyboardButton("Send location");
Message message = new Message();
sendMessage.setReplyMarkup(replyKeyboardMarkup);
replyKeyboardMarkup.setSelective(true);
replyKeyboardMarkup.setResizeKeyboard(true);
replyKeyboardMarkup.setOneTimeKeyboard(false);
List keyboardRowList = new ArrayList<>();
KeyboardRow keyboardFirstRow = new KeyboardRow();
keyboardFirstRow.add(keyboardButton);
keyboardFirstRow.add(keyboardButton1);
keyboardButton.setRequestContact(true);
keyboardButton1.setRequestLocation(true);
keyboardRowList.add(keyboardFirstRow);
replyKeyboardMarkup.setKeyboard(keyboardRowList);
}
Я хочу засунуть сам номер в переменную который я получил при нажатии на кнопку!