Skip to content

Commit

Permalink
Telegram bot: Fix deprecated method usage and simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
rmartinsanta committed Jan 25, 2024
1 parent 0dcc155 commit 328fa61
Showing 1 changed file with 1 addition and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,40 +109,22 @@ private static class MorkTelegramBot extends TelegramLongPollingBot {
*/
private final String chatId;

/**
* bot's token for communicating with the Telegram server
*/
private final String token;

/**
* Constructor
*
* @param chatId chat id
* @param token token
* @param options options
*/
private MorkTelegramBot(String chatId, String token, DefaultBotOptions options) {
super(options);
super(options, token);
this.chatId = chatId;
this.token = token;
}

@Override
public String getBotUsername() {
return "MorkTelegramIntegration";
}


/**
* This method returns the bot's token for communicating with the Telegram server
*
* @return the bot's token
*/
@Override
public String getBotToken() {
return token;
}

/**
* Method for receiving messages.
*
Expand Down

0 comments on commit 328fa61

Please sign in to comment.