com.pengrad.telegrambot.request.SendVoice 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.MessageEntity;
import com.pengrad.telegrambot.model.request.ParseMode;
import java.io.File;
/**
* stas
* 5/1/16.
*/
public class SendVoice extends AbstractMultipartRequest {
public SendVoice(Object chatId, String voice) {
super(chatId, voice);
}
public SendVoice(Object chatId, File voice) {
super(chatId, voice);
}
public SendVoice(Object chatId, byte[] voice) {
super(chatId, voice);
}
public SendVoice caption(String caption) {
return add("caption", caption);
}
public SendVoice parseMode(ParseMode parseMode) {
return add("parse_mode", parseMode.name());
}
public SendVoice captionEntities(MessageEntity... entities) {
return add("caption_entities", entities);
}
public SendVoice duration(int duration) {
return add("duration", duration);
}
@Override
protected String getFileParamName() {
return "voice";
}
@Override
public String getDefaultFileName() {
return ContentTypes.VOICE_FILE_NAME;
}
@Override
public String getDefaultContentType() {
return ContentTypes.VOICE_MIME_TYPE;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy