Skip to content

Commit

Permalink
Merge pull request #875 from dgangan/patch-1
Browse files Browse the repository at this point in the history
Update Getting-Started.md
  • Loading branch information
rubenlagus authored Mar 15, 2021
2 parents 1f8b7a0 + 87e3f23 commit bbaafbc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions TelegramBots.wiki/Getting-Started.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit bbaafbc

Please sign in to comment.