sendAudio
Send an audio file.
Parameters
The chat to send the audio file to.
The audio to send.
The duration of the audio file in seconds.
Names of the entities that are being featured in the audio.
The title of the audio.
The caption to attach.
The caption’s entities.
The parse mode to use for the caption. If not provided, the default parse mode will be used.
A thumbnail to assign. Cannot be a URL.
The file name to assign if applicable.
The file’s size.
The mime type to assign if applicable.
Size of each upload chunk in bytes.
Upload abort signal.
Whether to send the message in a silent way without making a sound on the recipients’ clients.
Whether to protect the contents of the message from copying and forwarding.
Information on what the message is replying to.
The identifier of a thread to send the message to.
The identifier of a chat to send the message on behalf of. User-only.
The identifier of a message effect to be attached to the message.
If specified, the message will be scheduled to be sent at that date. User-only.
The identifier of a business connection ID to perform the action on. Bot-only.
Result
The sent audio filr.
Syntax
// Required parameters only.
await client.sendAudio(chatId, audio);
// Required parameters + optional parameters.
// Any of the optional parameters can be omitted.
await client.sendAudio(chatId, audio, {
duration,
performer,
title,
caption,
captionEntities,
parseMode,
thumbnail,
fileName,
fileSize,
mimeType,
chunkSize,
signal,
disableNotification,
protectContent,
replyTo,
messageThreadId,
sendAs,
effectId,
sendAt,
businessConnectionId,
paidBroadcast,
});