Class: Rubirai::ImageMessage

Inherits:
Message
  • Object
show all
Defined in:
lib/rubirai/messages/message.rb

Overview

The image message type. Only one out of the three fields is needed to form the message.

Instance Attribute Summary collapse

Attributes inherited from Message

#bot, #type

Class Method Summary collapse

Methods inherited from Message

all_types, check_type, #to_h, to_message

Instance Attribute Details

#image_idString? (readonly)

Returns the image id from mirai.

Returns:

  • (String, nil)

    the image id from mirai



332
# File 'lib/rubirai/messages/message.rb', line 332

set_message :Image, :image_id, :url, :path

#pathString? (readonly)

Returns the local path of the image.

Returns:

  • (String, nil)

    the local path of the image



332
# File 'lib/rubirai/messages/message.rb', line 332

set_message :Image, :image_id, :url, :path

#urlString? (readonly)

Returns the url of the image.

Returns:

  • (String, nil)

    the url of the image



332
# File 'lib/rubirai/messages/message.rb', line 332

set_message :Image, :image_id, :url, :path

Class Method Details

.from(**kwargs) ⇒ Rubirai::ImageMessage

Form an Rubirai::ImageMessage. Only needs to give one of the three arguments.

Options Hash (**kwargs):

  • :image_id (String)

    the image id

  • :url (String)

    the url of the image

  • :path (String)

    the local path of the image

Returns:



332
# File 'lib/rubirai/messages/message.rb', line 332

set_message :Image, :image_id, :url, :path