Class SendPhoto
- java.lang.Object
-
- org.telegram.telegrambots.meta.api.methods.PartialBotApiMethod<Message>
-
- org.telegram.telegrambots.meta.api.methods.send.SendPhoto
-
- All Implemented Interfaces:
Validable
public class SendPhoto extends PartialBotApiMethod<Message>
- Version:
- 1.0 Use this method to send photos. On success, the sent Message is returned.
- Author:
- Ruben Bermudez
-
-
Field Summary
Fields Modifier and Type Field Description static StringCAPTION_FIELDstatic StringCHATID_FIELDstatic StringDISABLENOTIFICATION_FIELDstatic StringPARSEMODE_FIELDstatic StringPATHstatic StringPHOTO_FIELDstatic StringREPLYMARKUP_FIELDstatic StringREPLYTOMESSAGEID_FIELD-
Fields inherited from class org.telegram.telegrambots.meta.api.methods.PartialBotApiMethod
OBJECT_MAPPER
-
-
Constructor Summary
Constructors Constructor Description SendPhoto()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MessagedeserializeResponse(String answer)Deserialize a json answer to the response type to a methodSendPhotodisableNotification()SendPhotoenableNotification()StringgetCaption()StringgetChatId()BooleangetDisableNotification()StringgetParseMode()InputFilegetPhoto()ReplyKeyboardgetReplyMarkup()IntegergetReplyToMessageId()SendPhotosetCaption(String caption)SendPhotosetChatId(Long chatId)SendPhotosetChatId(String chatId)SendPhotosetParseMode(String parseMode)SendPhotosetPhoto(File file)SendPhotosetPhoto(String photo)SendPhotosetPhoto(String photoName, InputStream inputStream)SendPhotosetPhoto(InputFile photo)SendPhotosetReplyMarkup(ReplyKeyboard replyMarkup)SendPhotosetReplyToMessageId(Integer replyToMessageId)StringtoString()voidvalidate()Validates that mandatory fields are filled and optional objects
-
-
-
Field Detail
-
PATH
public static final String PATH
- See Also:
- Constant Field Values
-
CHATID_FIELD
public static final String CHATID_FIELD
- See Also:
- Constant Field Values
-
PHOTO_FIELD
public static final String PHOTO_FIELD
- See Also:
- Constant Field Values
-
CAPTION_FIELD
public static final String CAPTION_FIELD
- See Also:
- Constant Field Values
-
DISABLENOTIFICATION_FIELD
public static final String DISABLENOTIFICATION_FIELD
- See Also:
- Constant Field Values
-
REPLYTOMESSAGEID_FIELD
public static final String REPLYTOMESSAGEID_FIELD
- See Also:
- Constant Field Values
-
REPLYMARKUP_FIELD
public static final String REPLYMARKUP_FIELD
- See Also:
- Constant Field Values
-
PARSEMODE_FIELD
public static final String PARSEMODE_FIELD
- See Also:
- Constant Field Values
-
-
Method Detail
-
getChatId
public String getChatId()
-
getPhoto
public InputFile getPhoto()
-
getCaption
public String getCaption()
-
getReplyToMessageId
public Integer getReplyToMessageId()
-
getReplyMarkup
public ReplyKeyboard getReplyMarkup()
-
setReplyMarkup
public SendPhoto setReplyMarkup(ReplyKeyboard replyMarkup)
-
getDisableNotification
public Boolean getDisableNotification()
-
enableNotification
public SendPhoto enableNotification()
-
disableNotification
public SendPhoto disableNotification()
-
setPhoto
public SendPhoto setPhoto(String photoName, InputStream inputStream)
-
getParseMode
public String getParseMode()
-
deserializeResponse
public Message deserializeResponse(String answer) throws TelegramApiRequestException
Description copied from class:PartialBotApiMethodDeserialize a json answer to the response type to a method- Specified by:
deserializeResponsein classPartialBotApiMethod<Message>- Parameters:
answer- Json answer received- Returns:
- Answer for the method
- Throws:
TelegramApiRequestException
-
validate
public void validate() throws TelegramApiValidationExceptionDescription copied from interface:ValidableValidates that mandatory fields are filled and optional objects- Throws:
TelegramApiValidationException- If any mandatory field is empty
-
-