Class AbsSender
- java.lang.Object
-
- org.telegram.telegrambots.meta.bots.AbsSender
-
public abstract class AbsSender extends Object
- Version:
- 1.0
- Author:
- Ruben Bermudez
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbsSender()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description <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 Messageexecute(SendAudio sendAudio)Sends a file using Send Audio method (https://core.telegram.org/bots/api#sendaudio)abstract Messageexecute(SendDocument sendDocument)abstract List<Message>execute(SendMediaGroup sendMediaGroup)Send a media group (https://core.telegram.org/bots/api#sendMediaGroup)abstract Messageexecute(SendPhoto sendPhoto)abstract Messageexecute(SendSticker sendSticker)abstract Messageexecute(SendVideo sendVideo)abstract Messageexecute(SendVideoNote sendVideoNote)abstract Messageexecute(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 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 messageUsergetMe()CompletableFuture<User>getMeAsync()voidgetMeAsync(SentCallback<User> sentCallback)WebhookInfogetWebhookInfo()CompletableFuture<WebhookInfo>getWebhookInfoAsync()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)
-
-
-
Method Detail
-
executeAsync
public <T extends Serializable,Method extends BotApiMethod<T>,Callback extends SentCallback<T>> void executeAsync(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
public final User getMe() throws TelegramApiException
- Throws:
TelegramApiException
-
getWebhookInfo
public final WebhookInfo getWebhookInfo() throws TelegramApiException
- Throws:
TelegramApiException
-
getMeAsync
public final CompletableFuture<User> getMeAsync()
-
getWebhookInfoAsync
public final CompletableFuture<WebhookInfo> getWebhookInfoAsync()
-
getMeAsync
public final void getMeAsync(SentCallback<User> sentCallback) throws TelegramApiException
- Throws:
TelegramApiException
-
getWebhookInfoAsync
public final void getWebhookInfoAsync(SentCallback<WebhookInfo> sentCallback) throws TelegramApiException
- Throws:
TelegramApiException
-
execute
public abstract Message execute(SendDocument sendDocument) throws TelegramApiException
- Throws:
TelegramApiException
-
execute
public abstract Message execute(SendPhoto sendPhoto) throws TelegramApiException
- Throws:
TelegramApiException
-
execute
public abstract Message execute(SendVideo sendVideo) throws TelegramApiException
- Throws:
TelegramApiException
-
execute
public abstract Message execute(SendVideoNote sendVideoNote) throws TelegramApiException
- Throws:
TelegramApiException
-
execute
public abstract Message execute(SendSticker sendSticker) throws TelegramApiException
- Throws:
TelegramApiException
-
execute
public abstract Message execute(SendAudio sendAudio) throws TelegramApiException
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
public abstract Message execute(SendVoice sendVoice) throws TelegramApiException
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
public abstract List<Message> execute(SendMediaGroup sendMediaGroup) throws TelegramApiException
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
public abstract Boolean execute(SetChatPhoto setChatPhoto) throws TelegramApiException
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
public abstract Boolean execute(AddStickerToSet addStickerToSet) throws TelegramApiException
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
public abstract Boolean execute(SetStickerSetThumb setStickerSetThumb) throws TelegramApiException
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
public abstract File execute(UploadStickerFile uploadStickerFile) throws TelegramApiException
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
public abstract Serializable execute(EditMessageMedia editMessageMedia) throws TelegramApiException
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
public abstract Message execute(SendAnimation sendAnimation) throws TelegramApiException
Send animation- Parameters:
sendAnimation- Information of the animation- Returns:
- Sent message
- Throws:
TelegramApiException- If there is any error sending animation
-
executeAsync
public abstract CompletableFuture<Message> executeAsync(SendDocument sendDocument)
-
executeAsync
public abstract CompletableFuture<Message> executeAsync(SendPhoto sendPhoto)
-
executeAsync
public abstract CompletableFuture<Message> executeAsync(SendVideo sendVideo)
-
executeAsync
public abstract CompletableFuture<Message> executeAsync(SendVideoNote sendVideoNote)
-
executeAsync
public abstract CompletableFuture<Message> executeAsync(SendSticker sendSticker)
-
executeAsync
public abstract CompletableFuture<Message> executeAsync(SendAudio sendAudio)
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
public 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 OPUS- Parameters:
sendVoice- Information to send- Returns:
- If success, the sent Message is returned
-
executeAsync
public abstract CompletableFuture<List<Message>> executeAsync(SendMediaGroup sendMediaGroup)
Send a media group (https://core.telegram.org/bots/api#sendMediaGroup)- Returns:
- If success, list of generated messages
-
executeAsync
public abstract CompletableFuture<Boolean> executeAsync(SetChatPhoto setChatPhoto)
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
public abstract CompletableFuture<Boolean> executeAsync(AddStickerToSet addStickerToSet)
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
public abstract CompletableFuture<Boolean> executeAsync(SetStickerSetThumb setStickerSetThumb)
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
public abstract CompletableFuture<Boolean> executeAsync(CreateNewStickerSet createNewStickerSet)
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
public abstract CompletableFuture<File> executeAsync(UploadStickerFile uploadStickerFile)
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
public abstract CompletableFuture<Serializable> executeAsync(EditMessageMedia editMessageMedia)
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
public abstract CompletableFuture<Message> executeAsync(SendAnimation sendAnimation)
Send animation- Parameters:
sendAnimation- Information of the animation- Returns:
- Sent message
-
sendApiMethodAsync
protected abstract <T extends Serializable,Method extends BotApiMethod<T>,Callback extends SentCallback<T>> void sendApiMethodAsync(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
-
-