Send a photo.
The chat to send the photo to.
The photo to send.
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.
Whether to mark the media as a spoiler.
The file name to assign if applicable.
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.
The identifier of a message to reply to.
A specific part of the replying message’s text to quote.
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 reply markup of the message. Bot-only.
// Required parameters only.
await client.sendPhoto(chatId, photo);
// Required parameters + optional parameters.
// Any of the optional parameters can be omitted.
await client.sendPhoto(chatId, photo, {
selfDestruct,
caption,
captionEntities,
parseMode,
hasSpoiler,
fileName,
mimeType,
chunkSize,
signal,
disableNotification,
protectContent,
replyToMessageId,
replyQuote,
messageThreadId,
sendAs,
replyMarkup,
businessConnectionId,
});