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

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

There is a newer version: 7.2.1
Show newest version
package com.pengrad.telegrambot.request;

import com.pengrad.telegrambot.model.request.ReplyParameters;
import com.pengrad.telegrambot.model.request.Keyboard;
import com.pengrad.telegrambot.response.SendResponse;

/**
 * stas
 * 5/1/16.
 */
abstract public class AbstractSendRequest> extends BaseRequest {

    public AbstractSendRequest(Object chatId) {
        super(SendResponse.class);
        add("chat_id", chatId);
    }

    public T messageThreadId(Integer messageThreadId) {
        return add("message_thread_id", messageThreadId);
    }

    public T disableNotification(boolean disableNotification) {
        return add("disable_notification", disableNotification);
    }

    public T replyParameters(ReplyParameters replyParameters) {
        return add("reply_parameters", replyParameters);
    }

    /*
     @deprecated Use replyParameters instead
    */
    public T replyToMessageId(int replyToMessageId) {
        return add("reply_to_message_id", replyToMessageId);
    }

    /*
        @deprecated Use replyParameters instead
    */
    public T allowSendingWithoutReply(boolean allowSendingWithoutReply) {
        return add("allow_sending_without_reply", allowSendingWithoutReply);
    }

    public T replyMarkup(Keyboard replyMarkup) {
        return add("reply_markup", replyMarkup);
    }

    public T protectContent(boolean protectContent) {
        return add("protect_content", protectContent);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy