Class SendDocument
- java.lang.Object
-
- org.telegram.telegrambots.meta.api.methods.PartialBotApiMethod<Message>
-
- org.telegram.telegrambots.meta.api.methods.send.SendDocument
-
- All Implemented Interfaces:
Validable
public class SendDocument extends PartialBotApiMethod<Message>
- Version:
- 1.0 Use this method to send general files. On success, the sent Message is returned.
- Author:
- Ruben Bermudez
-
-
Field Summary
Fields Modifier and Type Field Description static String
CAPTION_FIELD
static String
CHATID_FIELD
static String
DISABLENOTIFICATION_FIELD
static String
DOCUMENT_FIELD
static String
PARSEMODE_FIELD
static String
PATH
static String
REPLYMARKUP_FIELD
static String
REPLYTOMESSAGEID_FIELD
static String
THUMB_FIELD
-
Fields inherited from class org.telegram.telegrambots.meta.api.methods.PartialBotApiMethod
OBJECT_MAPPER
-
-
Constructor Summary
Constructors Constructor Description SendDocument()
-
Method Summary
-
-
-
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
-
DOCUMENT_FIELD
public static final String DOCUMENT_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
-
THUMB_FIELD
public static final String THUMB_FIELD
- See Also:
- Constant Field Values
-
-
Method Detail
-
getChatId
public String getChatId()
-
setChatId
public SendDocument setChatId(String chatId)
-
setChatId
public SendDocument setChatId(Long chatId)
-
getDocument
public InputFile getDocument()
-
setDocument
public SendDocument setDocument(String document)
Use this method to set the document to an document existing in Telegram system- Parameters:
document
- File_id of the document to send
-
setDocument
public SendDocument setDocument(File file)
Use this method to set the document to a new file- Parameters:
file
- New document file
-
setDocument
public SendDocument setDocument(InputFile document)
-
setDocument
public SendDocument setDocument(String documentName, InputStream inputStream)
-
getReplyToMessageId
public Integer getReplyToMessageId()
-
setReplyToMessageId
public SendDocument setReplyToMessageId(Integer replyToMessageId)
-
getDisableNotification
public Boolean getDisableNotification()
-
enableNotification
public SendDocument enableNotification()
-
disableNotification
public SendDocument disableNotification()
-
getCaption
public String getCaption()
-
setCaption
public SendDocument setCaption(String caption)
-
getReplyMarkup
public ReplyKeyboard getReplyMarkup()
-
setReplyMarkup
public SendDocument setReplyMarkup(ReplyKeyboard replyMarkup)
-
getParseMode
public String getParseMode()
-
setParseMode
public SendDocument setParseMode(String parseMode)
-
getThumb
public InputFile getThumb()
-
setThumb
public SendDocument setThumb(InputFile thumb)
-
deserializeResponse
public Message deserializeResponse(String answer) throws TelegramApiRequestException
Description copied from class:PartialBotApiMethod
Deserialize a json answer to the response type to a method- Specified by:
deserializeResponse
in classPartialBotApiMethod<Message>
- Parameters:
answer
- Json answer received- Returns:
- Answer for the method
- Throws:
TelegramApiRequestException
-
validate
public void validate() throws TelegramApiValidationException
Description copied from interface:Validable
Validates that mandatory fields are filled and optional objects- Throws:
TelegramApiValidationException
- If any mandatory field is empty
-
-