Interface TelegramClient
public interface TelegramClient
-
Method Summary
Modifier and TypeMethodDescriptiondefault FiledownloadFile(String filePath) downloadFile(File file) default InputStreamdownloadFileAsStream(String filePath) downloadFileAsStream(File file) default CompletableFuture<InputStream>downloadFileAsStreamAsync(String filePath) default CompletableFuture<File>downloadFileAsync(String filePath) downloadFileAsync(File file) <T extends Serializable,Method extends BotApiMethod<T>>
Texecute(Method method) execute(SetChatPhoto setChatPhoto) Set chat profile photoexecute(SendAnimation sendAnimation) Send animationSends a file using Send Audio methodexecute(SendDocument sendDocument) execute(SendMediaGroup sendMediaGroup) Send a media groupexecute(SendSticker sendSticker) execute(SendVideoNote sendVideoNote) Sends a voice note using Send Voice method For this to work, your audio must be in an .ogg file encoded with OPUSexecute(AddStickerToSet addStickerToSet) Adds a new sticker to a setexecute(CreateNewStickerSet createNewStickerSet) Creates a new sticker set ≈execute(ReplaceStickerInSet replaceStickerInSet) Replace a sticker in a setexecute(SetStickerSetThumbnail setStickerSetThumbnail) Set sticker set thumbexecute(UploadStickerFile uploadStickerFile) Upload a new file as stickerexecute(EditMessageMedia editMessageMedia) Edit media in a message<T extends Serializable,Method extends BotApiMethod<T>>
CompletableFuture<T>executeAsync(Method method) executeAsync(SetChatPhoto setChatPhoto) Set chat profile photoexecuteAsync(SendAnimation sendAnimation) Send animationexecuteAsync(SendAudio sendAudio) Sends a file using the Send Audio methodexecuteAsync(SendDocument sendDocument) executeAsync(SendMediaGroup sendMediaGroup) Send a media groupexecuteAsync(SendPhoto sendPhoto) executeAsync(SendSticker sendSticker) executeAsync(SendVideo sendVideo) executeAsync(SendVideoNote sendVideoNote) executeAsync(SendVoice sendVoice) Sends a voice note using the Send Voice method For this to work, your audio must be in an .ogg file encoded with OPUSexecuteAsync(AddStickerToSet addStickerToSet) Adds a new sticker to a setexecuteAsync(CreateNewStickerSet createNewStickerSet) Creates a new sticker setexecuteAsync(ReplaceStickerInSet replaceStickerInSet) Replace a sticker in a setexecuteAsync(SetStickerSetThumbnail setStickerSetThumbnail) Set sticker set thumbexecuteAsync(UploadStickerFile uploadStickerFile) Upload a new file as stickerexecuteAsync(EditMessageMedia editMessageMedia) Edit media in a message
-
Method Details
-
executeAsync
<T extends Serializable,Method extends BotApiMethod<T>> CompletableFuture<T> executeAsync(Method method) throws TelegramApiException - Throws:
TelegramApiException
-
execute
<T extends Serializable,Method extends BotApiMethod<T>> T execute(Method method) 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- Parameters:
sendAudio- Information to send- Returns:
- If success, the sent Message is returned
- Throws:
TelegramApiException- If there is any error sending the audio- See Also:
-
execute
Sends a voice note using Send Voice method 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- See Also:
-
execute
Send a media group- Returns:
- If success, list of generated messages
- Throws:
TelegramApiException- If there is any error sending the media group- See Also:
-
execute
Set chat profile photo- Parameters:
setChatPhoto- Information to set the photo- Returns:
- If success, true is returned
- Throws:
TelegramApiException- If there is any error setting the photo.- See Also:
-
execute
Adds a new sticker to a set- 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- See Also:
-
execute
Replace a sticker in a set- Parameters:
replaceStickerInSet- 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- See Also:
-
execute
Set sticker set thumb- Parameters:
setStickerSetThumbnail- 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- See Also:
-
execute
Creates a new sticker set ≈- 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- See Also:
-
execute
Upload a new file as sticker- 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- See Also:
-
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
-
downloadFile
- Throws:
TelegramApiException
-
downloadFile
- Throws:
TelegramApiException
-
downloadFileAsStream
- Throws:
TelegramApiException
-
downloadFileAsStream
- Throws:
TelegramApiException
-
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 the Send Audio method- Parameters:
sendAudio- Information to send- Returns:
- If success, the sent Message is returned
-
executeAsync
Sends a voice note using the Send Voice method 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- Returns:
- If success, list of generated messages
- See Also:
-
executeAsync
Set chat profile photo- Parameters:
setChatPhoto- Information to set the photo- Returns:
- If success, true is returned
- See Also:
-
executeAsync
Adds a new sticker to a set- Parameters:
addStickerToSet- Information of the sticker to set- Returns:
- If success, true is returned
- See Also:
-
executeAsync
Replace a sticker in a set- Parameters:
replaceStickerInSet- Information of the sticker to set- Returns:
- If success, true is returned
- See Also:
-
executeAsync
Set sticker set thumb- Parameters:
setStickerSetThumbnail- Information of the sticker to set- Returns:
- If success, true is returned
- See Also:
-
executeAsync
Creates a new sticker set- Parameters:
createNewStickerSet- Information of the sticker set to create- Returns:
- If success, true is returned
- See Also:
-
executeAsync
Upload a new file as sticker- Parameters:
uploadStickerFile- Information of the file to upload as sticker- Returns:
- If success, true is returned
- See Also:
-
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
-
downloadFileAsync
-
downloadFileAsync
-
downloadFileAsStreamAsync
-
downloadFileAsStreamAsync
-