Class AbsSender
java.lang.Object
org.telegram.telegrambots.meta.bots.AbsSender
- Version:
- 1.0
- Author:
- Ruben Bermudez
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T extends Serializable,Method extends BotApiMethod<T>>
Texecute(Method method) abstract Booleanexecute(SetChatPhoto setChatPhoto) Set chat profile photo (https://core.telegram.org/bots/api#setChatPhoto)abstract Messageexecute(SendAnimation sendAnimation) Send animationabstract MessageSends a file using Send Audio method (https://core.telegram.org/bots/api#sendaudio)abstract Messageexecute(SendDocument sendDocument) execute(SendMediaGroup sendMediaGroup) Send a media group (https://core.telegram.org/bots/api#sendMediaGroup)abstract Messageabstract Messageexecute(SendSticker sendSticker) abstract Messageabstract Messageexecute(SendVideoNote sendVideoNote) abstract MessageSends a voice note using Send Voice method (https://core.telegram.org/bots/api#sendvoice) For this to work, your audio must be in an .ogg file encoded with OPUSabstract Booleanexecute(AddStickerToSet addStickerToSet) Adds a new sticker to a set (https://core.telegram.org/bots/api#addStickerToSet)abstract Booleanexecute(CreateNewStickerSet createNewStickerSet) Creates a new sticker set (https://core.telegram.org/bots/api#createNewStickerSet)abstract Booleanexecute(SetStickerSetThumb setStickerSetThumb) Set sticker set thumb (https://core.telegram.org/bots/api#setStickerSetThumb)abstract Fileexecute(UploadStickerFile uploadStickerFile) Upload a new file as sticker (https://core.telegram.org/bots/api#uploadStickerFile)abstract Serializableexecute(EditMessageMedia editMessageMedia) Edit media in a message<T extends Serializable,Method extends BotApiMethod<T>>
CompletableFuture<T>executeAsync(Method method) <T extends Serializable,Method extends BotApiMethod<T>, Callback extends SentCallback<T>>
voidexecuteAsync(Method method, Callback callback) abstract CompletableFuture<Boolean>executeAsync(SetChatPhoto setChatPhoto) Set chat profile photo (https://core.telegram.org/bots/api#setChatPhoto)abstract CompletableFuture<Message>executeAsync(SendAnimation sendAnimation) Send animationabstract CompletableFuture<Message>executeAsync(SendAudio sendAudio) Sends a file using Send Audio method (https://core.telegram.org/bots/api#sendaudio)abstract CompletableFuture<Message>executeAsync(SendDocument sendDocument) abstract CompletableFuture<List<Message>>executeAsync(SendMediaGroup sendMediaGroup) Send a media group (https://core.telegram.org/bots/api#sendMediaGroup)abstract CompletableFuture<Message>executeAsync(SendPhoto sendPhoto) abstract CompletableFuture<Message>executeAsync(SendSticker sendSticker) abstract CompletableFuture<Message>executeAsync(SendVideo sendVideo) abstract CompletableFuture<Message>executeAsync(SendVideoNote sendVideoNote) abstract CompletableFuture<Message>executeAsync(SendVoice sendVoice) Sends a voice note using Send Voice method (https://core.telegram.org/bots/api#sendvoice) For this to work, your audio must be in an .ogg file encoded with OPUSabstract CompletableFuture<Boolean>executeAsync(AddStickerToSet addStickerToSet) Adds a new sticker to a set (https://core.telegram.org/bots/api#addStickerToSet)abstract CompletableFuture<Boolean>executeAsync(CreateNewStickerSet createNewStickerSet) Creates a new sticker set (https://core.telegram.org/bots/api#createNewStickerSet)abstract CompletableFuture<Boolean>executeAsync(SetStickerSetThumb setStickerSetThumb) Set sticker set thumb (https://core.telegram.org/bots/api#setStickerSetThumb)abstract CompletableFuture<File>executeAsync(UploadStickerFile uploadStickerFile) Upload a new file as sticker (https://core.telegram.org/bots/api#uploadStickerFile)abstract CompletableFuture<Serializable>executeAsync(EditMessageMedia editMessageMedia) Edit media in a messagefinal UsergetMe()final CompletableFuture<User>final voidgetMeAsync(SentCallback<User> sentCallback) final WebhookInfofinal CompletableFuture<WebhookInfo>final voidgetWebhookInfoAsync(SentCallback<WebhookInfo> sentCallback) protected abstract <T extends Serializable,Method extends BotApiMethod<T>>
TsendApiMethod(Method method) protected abstract <T extends Serializable,Method extends BotApiMethod<T>>
CompletableFuture<T>sendApiMethodAsync(Method method) protected abstract <T extends Serializable,Method extends BotApiMethod<T>, Callback extends SentCallback<T>>
voidsendApiMethodAsync(Method method, Callback callback)
-
Constructor Details
-
AbsSender
protected AbsSender()
-
-
Method Details
-
executeAsync
public <T extends Serializable,Method extends BotApiMethod<T>, void executeAsyncCallback extends SentCallback<T>> (Method method, Callback callback) throws TelegramApiException - Throws:
TelegramApiException
-
executeAsync
public <T extends Serializable,Method extends BotApiMethod<T>> CompletableFuture<T> executeAsync(Method method) throws TelegramApiException - Throws:
TelegramApiException
-
execute
public <T extends Serializable,Method extends BotApiMethod<T>> T execute(Method method) throws TelegramApiException - Throws:
TelegramApiException
-
getMe
- Throws:
TelegramApiException
-
getWebhookInfo
- Throws:
TelegramApiException
-
getMeAsync
-
getWebhookInfoAsync
-
getMeAsync
- Throws:
TelegramApiException
-
getWebhookInfoAsync
public final void getWebhookInfoAsync(SentCallback<WebhookInfo> sentCallback) throws TelegramApiException - Throws:
TelegramApiException
-
execute
- Throws:
TelegramApiException
-
execute
- Throws:
TelegramApiException
-
execute
- Throws:
TelegramApiException
-
execute
- Throws:
TelegramApiException
-
execute
- Throws:
TelegramApiException
-
execute
Sends a file using Send Audio method (https://core.telegram.org/bots/api#sendaudio)- Parameters:
sendAudio- Information to send- Returns:
- If success, the sent Message is returned
- Throws:
TelegramApiException- If there is any error sending the audio
-
execute
Sends a voice note using Send Voice method (https://core.telegram.org/bots/api#sendvoice) For this to work, your audio must be in an .ogg file encoded with OPUS- Parameters:
sendVoice- Information to send- Returns:
- If success, the sent Message is returned
- Throws:
TelegramApiException- If there is any error sending the audio
-
execute
Send a media group (https://core.telegram.org/bots/api#sendMediaGroup)- Returns:
- If success, list of generated messages
- Throws:
TelegramApiException- If there is any error sending the media group
-
execute
Set chat profile photo (https://core.telegram.org/bots/api#setChatPhoto)- Parameters:
setChatPhoto- Information to set the photo- Returns:
- If success, true is returned
- Throws:
TelegramApiException- If there is any error setting the photo.
-
execute
Adds a new sticker to a set (https://core.telegram.org/bots/api#addStickerToSet)- Parameters:
addStickerToSet- Information of the sticker to set- Returns:
- If success, true is returned
- Throws:
TelegramApiException- If there is any error adding the sticker to the set
-
execute
Set sticker set thumb (https://core.telegram.org/bots/api#setStickerSetThumb)- Parameters:
setStickerSetThumb- Information of the sticker to set- Returns:
- If success, true is returned
- Throws:
TelegramApiException- If there is any error setting the thumb to the set
-
execute
public abstract Boolean execute(CreateNewStickerSet createNewStickerSet) throws TelegramApiException Creates a new sticker set (https://core.telegram.org/bots/api#createNewStickerSet)- Parameters:
createNewStickerSet- Information of the sticker set to create- Returns:
- If success, true is returned
- Throws:
TelegramApiException- If there is any error creating the new sticker set
-
execute
Upload a new file as sticker (https://core.telegram.org/bots/api#uploadStickerFile)- Parameters:
uploadStickerFile- Information of the file to upload as sticker- Returns:
- If success, true is returned
- Throws:
TelegramApiException- If there is any error uploading the new file
-
execute
Edit media in a message- Parameters:
editMessageMedia- Information of the new media- Returns:
- If the edited message is not an inline message, the edited Message is returned, otherwise True is returned
- Throws:
TelegramApiException- If there is any error editing the media
-
execute
Send animation- Parameters:
sendAnimation- Information of the animation- Returns:
- Sent message
- Throws:
TelegramApiException- If there is any error sending animation
-
executeAsync
-
executeAsync
-
executeAsync
-
executeAsync
-
executeAsync
-
executeAsync
Sends a file using Send Audio method (https://core.telegram.org/bots/api#sendaudio)- Parameters:
sendAudio- Information to send- Returns:
- If success, the sent Message is returned
-
executeAsync
Sends a voice note using Send Voice method (https://core.telegram.org/bots/api#sendvoice) For this to work, your audio must be in an .ogg file encoded with OPUS- Parameters:
sendVoice- Information to send- Returns:
- If success, the sent Message is returned
-
executeAsync
Send a media group (https://core.telegram.org/bots/api#sendMediaGroup)- Returns:
- If success, list of generated messages
-
executeAsync
Set chat profile photo (https://core.telegram.org/bots/api#setChatPhoto)- Parameters:
setChatPhoto- Information to set the photo- Returns:
- If success, true is returned
-
executeAsync
Adds a new sticker to a set (https://core.telegram.org/bots/api#addStickerToSet)- Parameters:
addStickerToSet- Information of the sticker to set- Returns:
- If success, true is returned
-
executeAsync
Set sticker set thumb (https://core.telegram.org/bots/api#setStickerSetThumb)- Parameters:
setStickerSetThumb- Information of the sticker to set- Returns:
- If success, true is returned
-
executeAsync
Creates a new sticker set (https://core.telegram.org/bots/api#createNewStickerSet)- Parameters:
createNewStickerSet- Information of the sticker set to create- Returns:
- If success, true is returned
-
executeAsync
Upload a new file as sticker (https://core.telegram.org/bots/api#uploadStickerFile)- Parameters:
uploadStickerFile- Information of the file to upload as sticker- Returns:
- If success, true is returned
-
executeAsync
Edit media in a message- Parameters:
editMessageMedia- Information of the new media- Returns:
- If the edited message is not an inline message, the edited Message is returned, otherwise True is returned
-
executeAsync
Send animation- Parameters:
sendAnimation- Information of the animation- Returns:
- Sent message
-
sendApiMethodAsync
protected abstract <T extends Serializable,Method extends BotApiMethod<T>, void sendApiMethodAsyncCallback extends SentCallback<T>> (Method method, Callback callback) -
sendApiMethodAsync
protected abstract <T extends Serializable,Method extends BotApiMethod<T>> CompletableFuture<T> sendApiMethodAsync(Method method) -
sendApiMethod
protected abstract <T extends Serializable,Method extends BotApiMethod<T>> T sendApiMethod(Method method) throws TelegramApiException - Throws:
TelegramApiException
-