Skip to content

Commit ade59a3

Browse files
scomarlfpengrad
authored andcommitted
Add a token attribute to the bot
1 parent e4aeb86 commit ade59a3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

library/src/main/java/com/pengrad/telegrambot/TelegramBot.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
*/
2525
public class TelegramBot {
2626

27+
private final String token;
2728
private final TelegramBotClient api;
2829
private final FileApi fileApi;
2930
private final UpdatesHandler updatesHandler;
@@ -33,6 +34,7 @@ public TelegramBot(String botToken) {
3334
}
3435

3536
TelegramBot(Builder builder) {
37+
this.token = builder.botToken;
3638
this.api = builder.api;
3739
this.fileApi = builder.fileApi;
3840
this.updatesHandler = builder.updatesHandler;
@@ -46,6 +48,10 @@ public <T extends BaseRequest<T, R>, R extends BaseResponse> void execute(T requ
4648
api.send(request, callback);
4749
}
4850

51+
public String getToken() {
52+
return token;
53+
}
54+
4955
public String getFullFilePath(File file) {
5056
return fileApi.getFullFilePath(file.filePath());
5157
}

0 commit comments

Comments
 (0)