sendAudio method
Future<Message>
sendAudio(
- ChatID chatId,
- HttpFile audio, {
- ParseMode? parseMode,
- int? duration,
- String? performer,
- String? title,
- HttpFile? thumb,
- bool? disableNotification,
- bool? protectContent,
- int? replyToMessageId,
- bool? allowSendingWithoutReply,
- 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,
});
}