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

org.telegram.telegrambots.api.methods.send.SendAudio Maven / Gradle / Ivy

There is a newer version: 0.1.1
Show newest version
package org.telegram.telegrambots.api.methods.send;

import java.io.File;
import java.io.InputStream;

import javax.ws.rs.Path;

import org.telegram.telegrambots.api.objects.replykeyboard.ReplyKeyboard;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
 * 
 * @author Lev Nadeinsky
 * @author Ruben Bermudez
 * @brief Use this method to send audio files, Use this method to send audio files, if you want
 * Telegram clients to display them in the music player. Your audio must be in an .mp3 format. On
 * success, the sent Message is returned. Bots can currently send audio files of up to 50 MB in
 * size, this limit may be changed in the future.
 * @note For sending voice notes, use sendVoice method instead.
 * @date	2016-11-21
 */
@Data
@ToString(callSuper=false)
@EqualsAndHashCode(callSuper=false)
@Path("sendaudio")
public class SendAudio extends ApiMethod{

    Integer duration; ///< Integer	Duration of the audio in seconds as defined by sender
    String chatId; ///< Unique identifier for the chat to send the message to (or Username fro channels)
    String audio; ///< Audio file to send. file_id as String to resend an audio that is already on the Telegram servers
    Integer replyToMessageId; ///< Optional. If the message is a reply, ID of the original message
    /**
     * Optional. Sends the message silently. iOS users will not receive a notification, Android
     * users will receive a notification with no sound. Other apps coming soon
     */
    Boolean disableNotification;
    ReplyKeyboard replyMarkup; ///< Optional. JSON-serialized object for a custom reply keyboard
    String performer; ///< Optional. Performer of sent audio
    String title; ///< Optional. Title of sent audio

    boolean isNewAudio; ///< True to upload a new audio, false to use a fileId
    String audioName;
    File newAudioFile; ///< New audio file
    InputStream newAudioStream; ///< New audio stream
   
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy