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

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

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

import com.pengrad.telegrambot.model.MessageEntity;
import com.pengrad.telegrambot.model.request.ParseMode;

import java.io.File;

/**
 * stas
 * 5/2/16.
 */
public class SendDocument extends AbstractMultipartRequest {

    public SendDocument(Object chatId, String document) {
        super(chatId, document);
    }

    public SendDocument(Object chatId, File document) {
        super(chatId, document);
    }

    public SendDocument(Object chatId, byte[] document) {
        super(chatId, document);
    }

    public SendDocument thumb(byte[] thumb) {
        return super.thumb(thumb);
    }

    public SendDocument thumb(File thumb) {
        return super.thumb(thumb);
    }

    public SendDocument caption(String caption) {
        return add("caption", caption);
    }

    public SendDocument parseMode(ParseMode parseMode) {
        return add("parse_mode", parseMode.name());
    }

    public SendDocument captionEntities(MessageEntity... entities) {
        return add("caption_entities", entities);
    }

    public SendDocument disableContentTypeDetection(boolean disableContentTypeDetection) {
        return add("disable_content_type_detection", disableContentTypeDetection);
    }

    @Override
    protected String getFileParamName() {
        return "document";
    }

    @Override
    public String getDefaultFileName() {
        return ContentTypes.DOC_FILE_NAME;
    }

    @Override
    public String getDefaultContentType() {
        return ContentTypes.DOC_MIME_TYPE;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy