Class InputMediaAudio

java.lang.Object
io.github.natanimn.telebof.types.input.InputMediaBuilder<InputMediaAudio>
io.github.natanimn.telebof.types.input.InputMediaAudio
All Implemented Interfaces:
InputMedia, Serializable

public class InputMediaAudio extends InputMediaBuilder<InputMediaAudio>
Represents an audio file to be treated as music to be sent.
Since:
3 March 2025
See Also:
  • Constructor Details

    • InputMediaAudio

      public InputMediaAudio(String media)
      Required
      Parameters:
      media - File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended). pass an HTTP URL for Telegram to get a file from the Internet.
    • InputMediaAudio

      public InputMediaAudio(File media)
      Required
      Parameters:
      media - File to send. Pass an object of File to upload from your local machine.
  • Method Details

    • setThumbnail

      public InputMediaAudio setThumbnail(String thumbnail)
      Optional.
      Parameters:
      thumbnail - Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side.
    • setPerformer

      public InputMediaAudio setPerformer(String performer)
      Optional.
      Parameters:
      performer - Performer of the audio
    • setTitle

      public InputMediaAudio setTitle(String title)
      Optional.
      Parameters:
      title - Title of the audio
    • setDuration

      public InputMediaAudio setDuration(Integer duration)
      Optional.
      Parameters:
      duration - Duration of the audio in seconds
    • setHasSpoiler

      public InputMediaAudio setHasSpoiler(Boolean hasSpoiler)
      Optional.
      Parameters:
      hasSpoiler - Pass True if the audio needs to be covered with a spoiler animation