Merge pull request #875 from dgangan/patch-1

Update Getting-Started.md
This commit is contained in:
Ruben Bermudez 2021-03-15 01:35:22 +00:00 committed by GitHub
commit bbaafbc2a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -84,9 +84,10 @@ Now that we have the library, we can start coding. There are few steps to follow
public void onUpdateReceived(Update update) {
// We check if the update has a message and the message has text
if (update.hasMessage() && update.getMessage().hasText()) {
SendMessage message = new SendMessage() // Create a SendMessage object with mandatory fields
.setChatId(update.getMessage().getChatId())
.setText(update.getMessage().getText());
SendMessage message = new SendMessage(); // Create a SendMessage object with mandatory fields
message.setChatId(update.getMessage().getChatId().toString());
message.setText(update.getMessage().getText());
try {
execute(message); // Call method to send the message
} catch (TelegramApiException e) {