sendAudio method

Future<Message> sendAudio(
  1. ChatID chatId,
  2. HttpFile audio, {
  3. String? caption,
  4. ParseMode? parseMode,
  5. List<MessageEntity>? captionEntities,
  6. int? duration,
  7. String? performer,
  8. String? title,
  9. HttpFile? thumb,
  10. bool? disableNotification,
  11. bool? protectContent,
  12. int? replyToMessageId,
  13. bool? allowSendingWithoutReply,
  14. ReplyMarkup? replyMarkup,
})
inherited

Use this method to send audio files, if you want Telegram clients to display them in the music player.

Your audio must be in the .MP3 or .M4A 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.

For sending voice messages, use the sendVoice method instead.

Implementation

Future<Message> sendAudio(
  ChatID chatId,
  HttpFile audio, {
  String? caption,
  ParseMode? parseMode,
  List<MessageEntity>? captionEntities,
  int? duration,
  String? performer,
  String? title,
  HttpFile? thumb,
  bool? disableNotification,
  bool? protectContent,
  int? replyToMessageId,
  bool? allowSendingWithoutReply,
  ReplyMarkup? replyMarkup,
}) {
  return _client.apiCall(_token, 'sendAudio', {
    'chat_id': chatId,
    'audio': audio,
    'caption': caption,
    'parse_mode': parseMode,
    'caption_entities': captionEntities,
    'duration': duration,
    'performer': performer,
    'title': title,
    'thumb': thumb,
    'disable_notification': disableNotification,
    'protect_content': protectContent,
    'reply_to_message_id': replyToMessageId,
    'allow_sending_without_reply': allowSendingWithoutReply,
    'reply_markup': replyMarkup,
  });
}