I'm working with telegram bot api, and I want to send messages to user in a determined time, but the bot needs to recipt an "message" to send something, my question is: Is possible to send an Update simulating the user interactions?
I means something like this: Here I create the update to simulate an user interaction (sendUpdate) is a custom method just for example this doesn't works actually
public void sendUpdate() {
//sending the update to simulate user interaction
Update upd = new Update();
//method that telegram bot api uses to reply when you send a message to the bot
onUpdateReceived(upd);
}
@Override
//Here I want to recipt my update to simulate the user interaction, and send a message witout user input
public void onUpdateReceived(Update update) {
System.out.println(update);
LOGGER.setLevel(Level.ALL);
LOGGER.addHandler(new ConsoleHandler());
LOGGER.info("2");
if (update.hasMessage() && update.getMessage().hasText()) {
// Set variables
String message_text = "Message";
long chat_id = update.getMessage().getChatId();
SendMessage message = new SendMessage()
.setChatId(chat_id)
.setText(message_text);
try {
this.sendMessage(message);
} catch (TelegramApiException e) {
e.printStackTrace();
}
}
}

this.sendMessage(message);- shazin