com.pengrad.telegrambot.request.AddStickerToSet Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-telegram-bot-api Show documentation
Show all versions of java-telegram-bot-api Show documentation
Java API for Telegram Bot API
package com.pengrad.telegrambot.request;
import com.pengrad.telegrambot.model.MaskPosition;
import com.pengrad.telegrambot.model.request.InputSticker;
import com.pengrad.telegrambot.response.BaseResponse;
/**
* Stas Parshin
* 23 July 2017
*/
public class AddStickerToSet extends AbstractUploadRequest {
public AddStickerToSet(Long userId, String name, InputSticker sticker) {
super(BaseResponse.class, attachName(sticker), attachment(sticker));
add("user_id", userId);
add("name", name);
add("sticker", sticker);
}
private static String attachName(InputSticker sticker) {
return sticker.getAttachment() != null ? sticker.getAttachName() : "sticker_id";
}
private static Object attachment(InputSticker sticker) {
return sticker.getAttachment() != null ? sticker.getAttachment() : "sticker_id";
}
/**
* @deprecated Use maskPosition on InputSticker (since API v6.6)
*/
@Deprecated
public AddStickerToSet maskPosition(MaskPosition maskPosition) {
return add("mask_position", maskPosition);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy