Method: Telebot::Client#send_photo

Defined in:
lib/telebot/client.rb

#send_photo(chat_id:, photo:, caption: nil, reply_to_message_id: nil, reply_markup: nil) ⇒ Telebot::Message

Send a picture.

Parameters:

  • chat_id (Integer)

    Unique identifier for the message recipient - User or GroupChat id

  • photo (InputFile, String)

    Photo to send. You can either pass a file_id as String to resend a photo that is already on the Telegram servers, or upload a new photo using multipart/form-data.

  • caption (String) (defaults to: nil)

    Photo caption (may also be used when resending photos by file_id)

  • reply_to_message_id (Integer) (defaults to: nil)

    If the message is a reply, ID of the original message

  • reply_markup (ReplyKeyboardMarkup, ReplyKeyboardHide, ForceReply) (defaults to: nil)

    Additional interface options

Returns:



100
101
102
103
# File 'lib/telebot/client.rb', line 100

def send_photo(chat_id:, photo:, caption: nil, reply_to_message_id: nil, reply_markup: nil)
  result = call(:sendPhoto, chat_id: chat_id, photo: photo, caption: caption, reply_to_message_id: reply_to_message_id, reply_markup: reply_markup)
  Message.new(result)
end