All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pengrad.telegrambot.request.AddStickerToSet Maven / Gradle / Ivy

There is a newer version: 7.11.0
Show newest version
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