com.annimon.tgbotsmodule.api.methods.send.SendAudioMethod Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tgbots-module Show documentation
Show all versions of tgbots-module Show documentation
Simple Java telegram bots runner built on top of the Telegram Bots library
The newest version!
package com.annimon.tgbotsmodule.api.methods.send;
import com.annimon.tgbotsmodule.api.methods.interfaces.CaptionMethod;
import com.annimon.tgbotsmodule.api.methods.interfaces.DurationMethod;
import com.annimon.tgbotsmodule.api.methods.interfaces.MediaMessageMethod;
import com.annimon.tgbotsmodule.api.methods.interfaces.ParseModeMethod;
import com.annimon.tgbotsmodule.api.methods.interfaces.ThumbMethod;
import com.annimon.tgbotsmodule.services.CommonAbsSender;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import org.jetbrains.annotations.NotNull;
import org.telegram.telegrambots.meta.api.methods.send.SendAudio;
import org.telegram.telegrambots.meta.api.objects.InputFile;
import org.telegram.telegrambots.meta.api.objects.MessageEntity;
import org.telegram.telegrambots.meta.api.objects.ReplyParameters;
import org.telegram.telegrambots.meta.api.objects.message.Message;
import org.telegram.telegrambots.meta.api.objects.replykeyboard.ReplyKeyboard;
public class SendAudioMethod implements
MediaMessageMethod,
ParseModeMethod,
CaptionMethod,
DurationMethod,
ThumbMethod {
private final SendAudio.SendAudioBuilder, ?> method;
public SendAudioMethod() {
this(SendAudio.builder());
}
public SendAudioMethod(@NotNull SendAudio.SendAudioBuilder, ?> method) {
this.method = method;
}
@Override
public String getChatId() {
return method.build().getChatId();
}
@Override
public SendAudioMethod setChatId(@NotNull String chatId) {
method.chatId(chatId);
return this;
}
@Override
public Integer getReplyToMessageId() {
return method.build().getReplyToMessageId();
}
@Override
public SendAudioMethod setReplyToMessageId(Integer messageId) {
method.replyToMessageId(messageId);
return this;
}
@Override
public Integer getMessageThreadId() {
return method.build().getMessageThreadId();
}
@Override
public SendAudioMethod setMessageThreadId(Integer messageThreadId) {
method.messageThreadId(messageThreadId);
return this;
}
@Override
public Boolean getAllowSendingWithoutReply() {
return method.build().getAllowSendingWithoutReply();
}
@Override
public SendAudioMethod setAllowSendingWithoutReply(Boolean allowSendingWithoutReply) {
method.allowSendingWithoutReply(allowSendingWithoutReply);
return this;
}
@Override
public boolean isNotificationDisabled() {
return Boolean.TRUE.equals(method.build().getDisableNotification());
}
@Override
public SendAudioMethod enableNotification() {
method.disableNotification(false);
return this;
}
@Override
public SendAudioMethod disableNotification() {
method.disableNotification(true);
return this;
}
@Override
public ReplyKeyboard getReplyMarkup() {
return method.build().getReplyMarkup();
}
@Override
public SendAudioMethod setReplyMarkup(ReplyKeyboard replyMarkup) {
method.replyMarkup(replyMarkup);
return this;
}
@Override
public InputFile getFile() {
return method.build().getAudio();
}
@Override
public SendAudioMethod setFile(@NotNull InputFile file) {
method.audio(file);
return this;
}
@Override
public String getParseMode() {
return method.build().getParseMode();
}
@Override
public SendAudioMethod setParseMode(String parseMode) {
method.parseMode(parseMode);
return this;
}
@Override
public List getEntities() {
return method.build().getCaptionEntities();
}
@Override
public SendAudioMethod setEntities(List entities) {
method.captionEntities(entities);
return this;
}
@Override
public String getCaption() {
return method.build().getCaption();
}
@Override
public SendAudioMethod setCaption(String caption) {
method.caption(caption);
return this;
}
@Override
public Integer getDuration() {
return method.build().getDuration();
}
@Override
public SendAudioMethod setDuration(@NotNull Integer duration) {
method.duration(duration);
return this;
}
@Override
public InputFile getThumbnail() {
return method.build().getThumbnail();
}
@Override
public SendAudioMethod setThumbnail(@NotNull InputFile thumb) {
method.thumbnail(thumb);
return this;
}
public String getPerformer() {
return method.build().getPerformer();
}
public SendAudioMethod setPerformer(String performer) {
method.performer(performer);
return this;
}
public String getTitle() {
return method.build().getTitle();
}
public SendAudioMethod setTitle(String title) {
method.title(title);
return this;
}
@Override
public Boolean getProtectContent() {
return method.build().getProtectContent();
}
@Override
public SendAudioMethod setProtectContent(Boolean protectContent) {
method.protectContent(protectContent);
return this;
}
@Override
public ReplyParameters getReplyParameters() {
return method.build().getReplyParameters();
}
@Override
public SendAudioMethod setReplyParameters(@NotNull ReplyParameters replyParameters) {
method.replyParameters(replyParameters);
return this;
}
@Override
public String getMessageEffectId() {
return method.build().getMessageEffectId();
}
@Override
public SendAudioMethod setMessageEffectId(String messageEffectId) {
method.messageEffectId(messageEffectId);
return this;
}
@Override
public String getBusinessConnectionId() {
return method.build().getBusinessConnectionId();
}
@Override
public SendAudioMethod setBusinessConnectionId(String id) {
method.businessConnectionId(id);
return this;
}
@Override
public Boolean getAllowPaidBroadcast() {
return method.build().getAllowPaidBroadcast();
}
@Override
public SendAudioMethod setAllowPaidBroadcast(Boolean flag) {
method.allowPaidBroadcast(flag);
return this;
}
@Override
public Message call(@NotNull CommonAbsSender sender) {
return sender.call(method.build());
}
@Override
public CompletableFuture callAsync(@NotNull CommonAbsSender sender) {
return sender.callAsync(method.build());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy