Class AddStickerToSet
- java.lang.Object
-
- org.telegram.telegrambots.meta.api.methods.PartialBotApiMethod<Boolean>
-
- org.telegram.telegrambots.meta.api.methods.stickers.AddStickerToSet
-
- All Implemented Interfaces:
Validable
public class AddStickerToSet extends PartialBotApiMethod<Boolean>
- Version:
- 1.0 Use this method to add a new sticker to a set created by the bot. You must use exactly one of the fields png_sticker or tgs_sticker. Animated stickers can be added to animated sticker sets and only to them. Animated sticker sets can have up to 50 stickers. Static sticker sets can have up to 120 stickers. Returns True on success.
- Author:
- Ruben Bermudez
-
-
Field Summary
Fields Modifier and Type Field Description static StringEMOJIS_FIELDstatic StringMASKPOSITION_FIELDstatic StringNAME_FIELDstatic StringPATHstatic StringPNGSTICKER_FIELDstatic StringTGSSTICKER_FIELDstatic StringUSERID_FIELD-
Fields inherited from class org.telegram.telegrambots.meta.api.methods.PartialBotApiMethod
OBJECT_MAPPER
-
-
Constructor Summary
Constructors Constructor Description AddStickerToSet()AddStickerToSet(Integer userId, String name, String emojis)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BooleandeserializeResponse(String answer)Deserialize a json answer to the response type to a methodStringgetEmojis()MaskPositiongetMaskPosition()StringgetName()InputFilegetPngSticker()InputFilegetTgsSticker()IntegergetUserId()AddStickerToSetsetEmojis(String emojis)AddStickerToSetsetMaskPosition(MaskPosition maskPosition)AddStickerToSetsetName(String name)AddStickerToSetsetPngSticker(File pngSticker)AddStickerToSetsetPngSticker(String pngSticker)AddStickerToSetsetPngSticker(String pngStickerName, InputStream pngSticker)AddStickerToSetsetTgsSticker(File tgsSticker)AddStickerToSetsetTgsSticker(String tgsStickerName, InputStream tgsSticker)AddStickerToSetsetUserId(Integer userId)StringtoString()voidvalidate()Validates that mandatory fields are filled and optional objects
-
-
-
Field Detail
-
PATH
public static final String PATH
- See Also:
- Constant Field Values
-
USERID_FIELD
public static final String USERID_FIELD
- See Also:
- Constant Field Values
-
NAME_FIELD
public static final String NAME_FIELD
- See Also:
- Constant Field Values
-
PNGSTICKER_FIELD
public static final String PNGSTICKER_FIELD
- See Also:
- Constant Field Values
-
TGSSTICKER_FIELD
public static final String TGSSTICKER_FIELD
- See Also:
- Constant Field Values
-
EMOJIS_FIELD
public static final String EMOJIS_FIELD
- See Also:
- Constant Field Values
-
MASKPOSITION_FIELD
public static final String MASKPOSITION_FIELD
- See Also:
- Constant Field Values
-
-
Method Detail
-
getUserId
public Integer getUserId()
-
setUserId
public AddStickerToSet setUserId(Integer userId)
-
getPngSticker
public InputFile getPngSticker()
-
setPngSticker
public AddStickerToSet setPngSticker(String pngSticker)
-
setPngSticker
public AddStickerToSet setPngSticker(File pngSticker)
-
setPngSticker
public AddStickerToSet setPngSticker(String pngStickerName, InputStream pngSticker)
-
setTgsSticker
public AddStickerToSet setTgsSticker(File tgsSticker)
-
setTgsSticker
public AddStickerToSet setTgsSticker(String tgsStickerName, InputStream tgsSticker)
-
getTgsSticker
public InputFile getTgsSticker()
-
getName
public String getName()
-
setName
public AddStickerToSet setName(String name)
-
getEmojis
public String getEmojis()
-
setEmojis
public AddStickerToSet setEmojis(String emojis)
-
getMaskPosition
public MaskPosition getMaskPosition()
-
setMaskPosition
public AddStickerToSet setMaskPosition(MaskPosition maskPosition)
-
deserializeResponse
public Boolean deserializeResponse(String answer) throws TelegramApiRequestException
Description copied from class:PartialBotApiMethodDeserialize a json answer to the response type to a method- Specified by:
deserializeResponsein classPartialBotApiMethod<Boolean>- 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
-
-