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 String
EMOJIS_FIELD
static String
MASKPOSITION_FIELD
static String
NAME_FIELD
static String
PATH
static String
PNGSTICKER_FIELD
static String
TGSSTICKER_FIELD
static String
USERID_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 Boolean
deserializeResponse(String answer)
Deserialize a json answer to the response type to a methodString
getEmojis()
MaskPosition
getMaskPosition()
String
getName()
InputFile
getPngSticker()
InputFile
getTgsSticker()
Integer
getUserId()
AddStickerToSet
setEmojis(String emojis)
AddStickerToSet
setMaskPosition(MaskPosition maskPosition)
AddStickerToSet
setName(String name)
AddStickerToSet
setPngSticker(File pngSticker)
AddStickerToSet
setPngSticker(String pngSticker)
AddStickerToSet
setPngSticker(String pngStickerName, InputStream pngSticker)
AddStickerToSet
setTgsSticker(File tgsSticker)
AddStickerToSet
setTgsSticker(String tgsStickerName, InputStream tgsSticker)
AddStickerToSet
setUserId(Integer userId)
String
toString()
void
validate()
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:PartialBotApiMethod
Deserialize a json answer to the response type to a method- Specified by:
deserializeResponse
in classPartialBotApiMethod<Boolean>
- 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
-
-