Package org.telegram.telegrambots.bots
Class DefaultAbsSender
java.lang.Object
org.telegram.telegrambots.meta.bots.AbsSender
org.telegram.telegrambots.bots.DefaultAbsSender
- Direct Known Subclasses:
TelegramLongPollingBot,TelegramWebhookBot
- Version:
- 1.0 Implementation of all the methods needed to interact with Telegram Servers
- Author:
- Ruben Bermudez
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefaultAbsSender(DefaultBotOptions options) Deprecated.Overwriting the getBotToken() method is deprecated.protectedDefaultAbsSender(DefaultBotOptions options, String botToken) -
Method Summary
Modifier and TypeMethodDescriptionfinal FiledownloadFile(String filePath) final FiledownloadFile(String filePath, File outputFile) final FiledownloadFile(File file) final FiledownloadFile(File file, File outputFile) final InputStreamdownloadFileAsStream(String filePath) final InputStreamdownloadFileAsStream(File file) final voiddownloadFileAsync(String filePath, DownloadFileCallback<String> callback) final voiddownloadFileAsync(File file, DownloadFileCallback<File> callback) execute(SetChatPhoto setChatPhoto) execute(SendAnimation sendAnimation) final MessageSends a file using Send Audio method (sendAudio)final Messageexecute(SendDocument sendDocument) execute(SendMediaGroup sendMediaGroup) final Messagefinal Messageexecute(SendSticker sendSticker) final Messagefinal Messageexecute(SendVideoNote sendVideoNote) final MessageSends a voice note using Send Voice method (sendVoice) For this to work, your audio must be in an .ogg file encoded with OPUSexecute(AddStickerToSet addStickerToSet) execute(CreateNewStickerSet createNewStickerSet) execute(SetStickerSetThumb setStickerSetThumb) execute(UploadStickerFile uploadStickerFile) execute(EditMessageMedia editMessageMedia) executeAsync(SetChatPhoto setChatPhoto) executeAsync(SendAnimation sendAnimation) executeAsync(SendAudio sendAudio) executeAsync(SendDocument sendDocument) executeAsync(SendMediaGroup sendMediaGroup) executeAsync(SendPhoto sendPhoto) executeAsync(SendSticker sendSticker) executeAsync(SendVideo sendVideo) executeAsync(SendVideoNote sendVideoNote) executeAsync(SendVoice sendVoice) executeAsync(AddStickerToSet addStickerToSet) executeAsync(CreateNewStickerSet createNewStickerSet) executeAsync(SetStickerSetThumb setStickerSetThumb) executeAsync(UploadStickerFile uploadStickerFile) executeAsync(EditMessageMedia editMessageMedia) Deprecated.Overriding this method is deprecated.final DefaultBotOptionsprotected final <T extends Serializable,Method extends BotApiMethod<T>>
TsendApiMethod(Method method) protected <T extends Serializable,Method extends BotApiMethod<T>>
CompletableFuture<T>sendApiMethodAsync(Method method) protected final <T extends Serializable,Method extends BotApiMethod<T>, Callback extends SentCallback<T>>
voidsendApiMethodAsync(Method method, Callback callback) Methods inherited from class org.telegram.telegrambots.meta.bots.AbsSender
execute, executeAsync, executeAsync, getMe, getMeAsync, getMeAsync, getWebhookInfo, getWebhookInfoAsync, getWebhookInfoAsync
-
Field Details
-
exe
-
-
Constructor Details
-
DefaultAbsSender
Deprecated.Overwriting the getBotToken() method is deprecated. Use the constructor insteadIf this is used getBotToken has to be overridden in order to return the bot token! -
DefaultAbsSender
-
-
Method Details
-
getBotToken
Deprecated.Overriding this method is deprecated. Pass to constructor insteadReturns the token of the bot to be able to perform Telegram Api Requests- Returns:
- Token of the bot
-
getOptions
-
getBaseUrl
-
downloadFile
- Throws:
TelegramApiException
-
downloadFile
- Throws:
TelegramApiException
-
downloadFile
- Throws:
TelegramApiException
-
downloadFile
- Throws:
TelegramApiException
-
downloadFileAsync
public final void downloadFileAsync(String filePath, DownloadFileCallback<String> callback) throws TelegramApiException - Throws:
TelegramApiException
-
downloadFileAsync
public final void downloadFileAsync(File file, DownloadFileCallback<File> callback) throws TelegramApiException - Throws:
TelegramApiException
-
downloadFileAsStream
- Throws:
TelegramApiException
-
downloadFileAsStream
- Throws:
TelegramApiException
-
execute
- Specified by:
executein classAbsSender- Throws:
TelegramApiException
-
execute
- Specified by:
executein classAbsSender- Throws:
TelegramApiException
-
execute
- Specified by:
executein classAbsSender- Throws:
TelegramApiException
-
execute
- Specified by:
executein classAbsSender- Throws:
TelegramApiException
-
execute
- Specified by:
executein classAbsSender- Throws:
TelegramApiException
-
execute
Sends a file using Send Audio method (sendAudio)- Specified by:
executein classAbsSender- Parameters:
sendAudio- Information to send- Returns:
- If success, the Message sent is returned
- Throws:
TelegramApiException- If there is any error sending the audio
-
execute
Sends a voice note using Send Voice method (sendVoice) For this to work, your audio must be in an .ogg file encoded with OPUS- Specified by:
executein classAbsSender- Parameters:
sendVoice- Information to send- Returns:
- If success, the Message sent is returned
- Throws:
TelegramApiException- If there is any error sending the audio
-
execute
- Specified by:
executein classAbsSender- Throws:
TelegramApiException
-
execute
- Specified by:
executein classAbsSender- Throws:
TelegramApiException
-
execute
- Specified by:
executein classAbsSender- Throws:
TelegramApiException
-
execute
- Specified by:
executein classAbsSender- Throws:
TelegramApiException
-
execute
- Specified by:
executein classAbsSender- Throws:
TelegramApiException
-
execute
- Specified by:
executein classAbsSender- Throws:
TelegramApiException
-
execute
- Specified by:
executein classAbsSender- Throws:
TelegramApiException
-
execute
- Specified by:
executein classAbsSender- Throws:
TelegramApiException
-
executeAsync
- Specified by:
executeAsyncin classAbsSender
-
executeAsync
- Specified by:
executeAsyncin classAbsSender
-
executeAsync
- Specified by:
executeAsyncin classAbsSender
-
executeAsync
- Specified by:
executeAsyncin classAbsSender
-
executeAsync
- Specified by:
executeAsyncin classAbsSender
-
executeAsync
- Specified by:
executeAsyncin classAbsSender
-
executeAsync
- Specified by:
executeAsyncin classAbsSender
-
executeAsync
- Specified by:
executeAsyncin classAbsSender
-
executeAsync
- Specified by:
executeAsyncin classAbsSender
-
executeAsync
- Specified by:
executeAsyncin classAbsSender
-
executeAsync
- Specified by:
executeAsyncin classAbsSender
-
executeAsync
- Specified by:
executeAsyncin classAbsSender
-
executeAsync
- Specified by:
executeAsyncin classAbsSender
-
executeAsync
- Specified by:
executeAsyncin classAbsSender
-
executeAsync
- Specified by:
executeAsyncin classAbsSender
-
sendApiMethodAsync
protected final <T extends Serializable,Method extends BotApiMethod<T>, void sendApiMethodAsyncCallback extends SentCallback<T>> (Method method, Callback callback) - Specified by:
sendApiMethodAsyncin classAbsSender
-
sendApiMethodAsync
protected <T extends Serializable,Method extends BotApiMethod<T>> CompletableFuture<T> sendApiMethodAsync(Method method) - Specified by:
sendApiMethodAsyncin classAbsSender
-
sendApiMethod
protected final <T extends Serializable,Method extends BotApiMethod<T>> T sendApiMethod(Method method) throws TelegramApiException - Specified by:
sendApiMethodin classAbsSender- Throws:
TelegramApiException
-