Class SendVideoNote
- java.lang.Object
-
- org.telegram.telegrambots.meta.api.methods.PartialBotApiMethod<Message>
-
- org.telegram.telegrambots.meta.api.methods.send.SendVideoNote
-
- All Implemented Interfaces:
Validable
public class SendVideoNote extends PartialBotApiMethod<Message>
- Version:
- 1.0 As of v.4.0, Telegram clients support rounded square mp4 videos of up to 1 minute long. Use this method to send video messages. On success, the sent Message is returned.
- Author:
- Ruben Bermudez
-
-
Field Summary
Fields Modifier and Type Field Description static StringCHATID_FIELDstatic StringDISABLENOTIFICATION_FIELDstatic StringDURATION_FIELDstatic StringLENGTH_FIELDstatic StringPATHstatic StringREPLYMARKUP_FIELDstatic StringREPLYTOMESSAGEID_FIELDstatic StringTHUMB_FIELDstatic StringVIDEONOTE_FIELD-
Fields inherited from class org.telegram.telegrambots.meta.api.methods.PartialBotApiMethod
OBJECT_MAPPER
-
-
Constructor Summary
Constructors Constructor Description SendVideoNote()SendVideoNote(Integer chatId, File videoNote)Creates a new video note with a video already present in telegram serversSendVideoNote(Integer chatId, String videoNoteName, InputStream videoNote)Creates a new video note with a video already present in telegram serversSendVideoNote(Long chatId, String videoNote)Creates a new video note with a video already present in telegram serversSendVideoNote(String chatId, File videoNote)Creates a new video note with a new video noteSendVideoNote(String chatId, String videoNote)Creates a new video note with a video already present in telegram serversSendVideoNote(String chatId, String videoNoteName, InputStream videoNote)Creates a new video note with a new video note
-
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
-
VIDEONOTE_FIELD
public static final String VIDEONOTE_FIELD
- See Also:
- Constant Field Values
-
DURATION_FIELD
public static final String DURATION_FIELD
- See Also:
- Constant Field Values
-
LENGTH_FIELD
public static final String LENGTH_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
-
THUMB_FIELD
public static final String THUMB_FIELD
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SendVideoNote
public SendVideoNote()
-
SendVideoNote
public SendVideoNote(String chatId, String videoNote)
Creates a new video note with a video already present in telegram servers- Parameters:
chatId- Chat Id to send the video notevideoNote- Video note file_id to send
-
SendVideoNote
public SendVideoNote(Long chatId, String videoNote)
Creates a new video note with a video already present in telegram servers- Parameters:
chatId- Chat Id to send the video notevideoNote- Video note file_id to send
-
SendVideoNote
public SendVideoNote(String chatId, File videoNote)
Creates a new video note with a new video note- Parameters:
chatId- Chat Id to send the video notevideoNote- Video note file to upload
-
SendVideoNote
public SendVideoNote(Integer chatId, File videoNote)
Creates a new video note with a video already present in telegram servers- Parameters:
chatId- Chat Id to send the video notevideoNote- Video note file to upload
-
SendVideoNote
public SendVideoNote(String chatId, String videoNoteName, InputStream videoNote)
Creates a new video note with a new video note- Parameters:
chatId- Chat Id to send the video notevideoNoteName- Name of the video note filevideoNote- Video note file to upload
-
SendVideoNote
public SendVideoNote(Integer chatId, String videoNoteName, InputStream videoNote)
Creates a new video note with a video already present in telegram servers- Parameters:
chatId- Chat Id to send the video notevideoNoteName- Name of the video note filevideoNote- Video note file to upload
-
-
Method Detail
-
getChatId
public String getChatId()
-
setChatId
public SendVideoNote setChatId(String chatId)
-
getVideoNote
public InputFile getVideoNote()
-
setVideoNote
public SendVideoNote setVideoNote(String videoNote)
-
getLength
public Integer getLength()
-
setLength
public SendVideoNote setLength(Integer length)
-
setChatId
public SendVideoNote setChatId(Long chatId)
-
getDuration
public Integer getDuration()
-
setDuration
public SendVideoNote setDuration(Integer duration)
-
getReplyToMessageId
public Integer getReplyToMessageId()
-
setReplyToMessageId
public SendVideoNote setReplyToMessageId(Integer replyToMessageId)
-
getReplyMarkup
public ReplyKeyboard getReplyMarkup()
-
setReplyMarkup
public SendVideoNote setReplyMarkup(ReplyKeyboard replyMarkup)
-
getDisableNotification
public Boolean getDisableNotification()
-
enableNotification
public SendVideoNote enableNotification()
-
disableNotification
public SendVideoNote disableNotification()
-
setVideoNote
public SendVideoNote setVideoNote(InputFile videoNote)
-
setVideoNote
public SendVideoNote setVideoNote(File file)
-
setVideoNote
public SendVideoNote setVideoNote(String videoName, InputStream inputStream)
-
getThumb
public InputFile getThumb()
-
setThumb
public SendVideoNote setThumb(InputFile thumb)
-
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
-
-