Module: Line::Bot::API::SendContent

Includes:
Constants
Included in:
Line::Bot::API
Defined in:
lib/line/bot/api/send_content.rb

Constant Summary

Constant Summary

Constants included from Constants

Constants::POST_EVENT_API_CHANEL_ID

Instance Method Summary (collapse)

Instance Method Details

- (Object) send_audio(mids, content_params)

Parameters:

  • mids (String)
  • content_params (Hash)

Options Hash (content_params):

  • :originalContentUrl (String)

    URL of audio file. The “m4a” format is recommended.

  • :contentMetadata["AUDLEN"] (String)

    Length of voice message. The unit is given in milliseconds.



36
37
38
# File 'lib/line/bot/api/send_content.rb', line 36

def send_audio(mids, content_params)
  perform_sending_message_request(mids, ContentType::AUDIO, content_params)
end

- (Object) send_image(mids, content_params)

Parameters:

  • mids (String)
  • content_params (Hash)

Options Hash (content_params):

  • :originalContentUrl (String)

    URL of image. Only JPEG format supported. Image size cannot be larger than 1024×1024.

  • :previewImageUrl (String)

    URL of thumbnail image. For preview. Only JPEG format supported. Image size cannot be larger than 240×240.



20
21
22
# File 'lib/line/bot/api/send_content.rb', line 20

def send_image(mids, content_params)
  perform_sending_message_request(mids, ContentType::IMAGE, content_params)
end

- (Object) send_location(mids, content_params)

Parameters:

  • mids (String)
  • content_params (Hash)

Options Hash (content_params):

  • :text (String)

    String used to explain the location information (example: name of restaurant, address).

  • :location["title"] (String)

    Assigned the same string as the text property.

  • :location["latitude"] (String)

    Latitude.

  • :location["longitude"] (String)

    Longitude.



46
47
48
# File 'lib/line/bot/api/send_content.rb', line 46

def send_location(mids, content_params)
  perform_sending_message_request(mids, ContentType::LOCATION, content_params)
end

- (Object) send_sticker(mids, content_params)

Parameters:

  • mids (String)
  • content_params (Hash)

Options Hash (content_params):

  • :contentMetadata["STKID"] (String)

    ID of the sticker.

  • :contentMetadata["STKPKGID"] (String)

    Package ID of the sticker.

  • :contentMetadata["STKVER"] (String)

    Optional. Version number of the sticker. If omitted, the latest version number is applied.



55
56
57
# File 'lib/line/bot/api/send_content.rb', line 55

def send_sticker(mids, content_params)
  perform_sending_message_request(mids, ContentType::STICKER, content_params)
end

- (Object) send_text(mids, content_params)

Parameters:

  • mids (String)
  • content_params (Hash)

Options Hash (content_params):

  • :text (String)

    String you want to send. Messages can contain up to 1024 characters.



12
13
14
# File 'lib/line/bot/api/send_content.rb', line 12

def send_text(mids, content_params)
  perform_sending_message_request(mids, ContentType::TEXT, content_params)
end

- (Object) send_video(mids, content_params)

Parameters:

  • mids (String)
  • content_params (Hash)

Options Hash (content_params):

  • :originalContentUrl (String)

    URL of the movie. The “mp4” format is recommended.

  • :previewImageUrl (String)

    URL of thumbnail image used as a preview.



28
29
30
# File 'lib/line/bot/api/send_content.rb', line 28

def send_video(mids, content_params)
  perform_sending_message_request(mids, ContentType::VIDEO, content_params)
end