Answer the question
In order to leave comments, you need to log in
How to handle the second response without exiting the loop?
Hello. I decided to write my own bot, but ran into a problem. Here is a piece of code
public void onUpdateReceived(Update update)
if (message != null && message.hasText()) {
switch (message.getText()) {
case "/start":
sendMsg(message, "Hi!");
System.out.println(message.getText());
break;
case "partial":
sendMsg(message, "starting \ninput number");
while(true){
if(update.getCallbackQuery().getMessage().getText().equals(g)) {
sendMsg(message,"ok, go");
try {
Scraper.scrape(partial);
} catch (IOException e) {
e.printStackTrace();
}
break;}}
System.out.println(message.getText());
break;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question