Class SendAnimation
- java.lang.Object
-
- org.telegram.telegrambots.meta.api.methods.PartialBotApiMethod<Message>
-
- org.telegram.telegrambots.meta.api.methods.send.SendAnimation
-
- All Implemented Interfaces:
Validable
public class SendAnimation extends PartialBotApiMethod<Message>
- Version:
- 4.0.0 Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent Message is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future.
- Author:
- Ruben Bermudez
-
-
Field Summary
Fields Modifier and Type Field Description static StringANIMATION_FIELDstatic StringCAPTION_FIELDstatic StringCHATID_FIELDstatic StringDISABLENOTIFICATION_FIELDstatic StringDURATION_FIELDstatic StringHEIGHT_FIELDstatic StringPARSEMODE_FIELDstatic StringPATHstatic StringREPLYMARKUP_FIELDstatic StringREPLYTOMESSAGEID_FIELDstatic StringTHUMB_FIELDstatic StringWIDTH_FIELD-
Fields inherited from class org.telegram.telegrambots.meta.api.methods.PartialBotApiMethod
OBJECT_MAPPER
-
-
Constructor Summary
Constructors Constructor Description SendAnimation()
-
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
-
ANIMATION_FIELD
public static final String ANIMATION_FIELD
- See Also:
- Constant Field Values
-
DURATION_FIELD
public static final String DURATION_FIELD
- See Also:
- Constant Field Values
-
WIDTH_FIELD
public static final String WIDTH_FIELD
- See Also:
- Constant Field Values
-
HEIGHT_FIELD
public static final String HEIGHT_FIELD
- See Also:
- Constant Field Values
-
CAPTION_FIELD
public static final String CAPTION_FIELD
- See Also:
- Constant Field Values
-
PARSEMODE_FIELD
public static final String PARSEMODE_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
-
-
Method Detail
-
getChatId
public String getChatId()
-
setChatId
public SendAnimation setChatId(String chatId)
-
getAnimation
public InputFile getAnimation()
-
setAnimation
public SendAnimation setAnimation(String animation)
-
setChatId
public SendAnimation setChatId(Long chatId)
-
getDuration
public Integer getDuration()
-
setDuration
public SendAnimation setDuration(Integer duration)
-
getCaption
public String getCaption()
-
setCaption
public SendAnimation setCaption(String caption)
-
getReplyToMessageId
public Integer getReplyToMessageId()
-
setReplyToMessageId
public SendAnimation setReplyToMessageId(Integer replyToMessageId)
-
getReplyMarkup
public ReplyKeyboard getReplyMarkup()
-
setReplyMarkup
public SendAnimation setReplyMarkup(ReplyKeyboard replyMarkup)
-
getDisableNotification
public Boolean getDisableNotification()
-
enableNotification
public SendAnimation enableNotification()
-
disableNotification
public SendAnimation disableNotification()
-
getWidth
public Integer getWidth()
-
setWidth
public SendAnimation setWidth(Integer width)
-
getHeight
public Integer getHeight()
-
setHeight
public SendAnimation setHeight(Integer height)
-
setAnimation
public SendAnimation setAnimation(File file)
-
setAnimation
public SendAnimation setAnimation(String animationName, InputStream inputStream)
-
setAnimation
public SendAnimation setAnimation(InputFile animation)
-
getParseMode
public String getParseMode()
-
setParseMode
public SendAnimation setParseMode(String parseMode)
-
getThumb
public InputFile getThumb()
-
setThumb
public SendAnimation 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
-
-