io.github.biezhi.tgbot.request.SendAudio Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of telegram-bot-api Show documentation
Show all versions of telegram-bot-api Show documentation
Telegram bot library by Java
The newest version!
package io.github.biezhi.tgbot.request;
import java.io.File;
/**
* stas
* 5/2/16.
*/
public class SendAudio extends AbstractMultipartRequest {
public SendAudio(Object chatId, String audio) {
super(chatId, audio);
}
public SendAudio(Object chatId, File audio) {
super(chatId, audio);
}
public SendAudio(Object chatId, byte[] audio) {
super(chatId, audio);
}
public SendAudio caption(String caption) {
return add("caption", caption);
}
public SendAudio duration(int duration) {
return add("duration", duration);
}
public SendAudio performer(String performer) {
return add("performer", performer);
}
public SendAudio title(String title) {
return add("title", title);
}
@Override
protected String getFileParamName() {
return "audio";
}
@Override
public String getDefaultFileName() {
return ContentTypes.AUDIO_FILE_NAME;
}
@Override
public String getContentType() {
return ContentTypes.AUDIO_MIME_TYPE;
}
}