
Use this method to send photos.
sendPhoto(chat_id, photo, caption = NULL, disable_notification = FALSE,
reply_to_message_id = NULL, reply_markup = NULL, parse_mode = NULL)
Unique identifier for the target chat or username of the target channel.
Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a local photo by passing a file path.
(Optional). Photo caption (may also be used when re-sending photos by file_id), 0-1024 characters.
(Optional). Sends the message silently. Users will receive a notification with no sound.
(Optional). If the message is a reply, ID of the original message.
(Optional). A Reply Markup parameter object, it can be either:
(Optional). Send 'Markdown' or 'HTML', if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your bot's message.
You can also use it's snake_case equivalent send_photo
.
# NOT RUN {
bot <- Bot(token = bot_token("RTelegramBot"))
chat_id <- user_id("Me")
photo_url <- "https://telegram.org/img/t_logo.png"
bot$sendPhoto(chat_id = chat_id,
photo = photo_url,
caption = "Telegram Logo")
# }
Run the code above in your browser using DataLab