Answer the question
In order to leave comments, you need to log in
Telegram Bot in Java. Why doesn't a message come up when I click on the Inline button?
public void onUpdateReceived(Update update) {
SendMessage sendMessage = new SendMessage();
if (update.hasCallbackQuery()) {
sendMessage.setChatId(update.getCallbackQuery().getMessage().getChatId());
String callbackText = update.getCallbackQuery().getData();
if (callbackText.equals("toUSD")) {
sendMessage.setText("Напишите сумму:");
System.out.println(sendMessage.getChatId()); //Проверка Chat ID
} else if (callbackText.equals("toEUR")) {
sendMessage.setText("Напишите сумму:");
}
}
}
Answer the question
In order to leave comments, you need to log in
Because you create an object sendMessage
, put text into it sendMessage.setText("Напишите сумму:");
, and then nothing happens.
You need a method .execute(sendMessage)
fromDefaultAbsSender
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question