Class PhotoSender
java.lang.Object
io.github.yvasyliev.forwarder.telegram.bot.service.sender.PhotoSender
- All Implemented Interfaces:
PostSender<CloseableSupplier<SendPhotoDTO>, org.telegram.telegrambots.meta.api.objects.message.Message>
@Service
public class PhotoSender
extends Object
implements PostSender<CloseableSupplier<SendPhotoDTO>, org.telegram.telegrambots.meta.api.objects.message.Message>
Sends a photo to a Telegram chat.
-
Constructor Summary
ConstructorsConstructorDescriptionPhotoSender(TelegramAdminProperties adminProperties, SendPhotoMapper sendPhotoMapper, org.telegram.telegrambots.meta.generics.TelegramClient telegramClient) -
Method Summary
Modifier and TypeMethodDescriptionorg.telegram.telegrambots.meta.api.objects.message.Messagesend(CloseableSupplier<SendPhotoDTO> sendPhotoDTOSupplier) Sends the given method to Telegram.
-
Constructor Details
-
PhotoSender
public PhotoSender(TelegramAdminProperties adminProperties, SendPhotoMapper sendPhotoMapper, org.telegram.telegrambots.meta.generics.TelegramClient telegramClient)
-
-
Method Details
-
send
public org.telegram.telegrambots.meta.api.objects.message.Message send(CloseableSupplier<SendPhotoDTO> sendPhotoDTOSupplier) throws IOException, org.telegram.telegrambots.meta.exceptions.TelegramApiException Description copied from interface:PostSenderSends the given method to Telegram.- Specified by:
sendin interfacePostSender<CloseableSupplier<SendPhotoDTO>, org.telegram.telegrambots.meta.api.objects.message.Message>- Parameters:
sendPhotoDTOSupplier- the method to be sent- Returns:
- the response received after sending
- Throws:
IOException- if an I/O error occursorg.telegram.telegrambots.meta.exceptions.TelegramApiException- if a Telegram API error occurs
-