Class: MTProto::TL::SendMultiMedia
- Inherits:
-
Object
- Object
- MTProto::TL::SendMultiMedia
- Includes:
- MediaParts
- Defined in:
- lib/mtproto/tl/objects/send_multi_media.rb
Overview
messages.sendMultiMedia — several photos as ONE message, the way a person sends an album.
The words ride on the first of them and nowhere else: an album carries a single caption, and repeating it under each picture is how it looks when somebody sends them one at a time.
Constant Summary collapse
- CONSTRUCTOR =
0x1bf89d74- INPUT_SINGLE_MEDIA =
0x1cc6e91f- INPUT_REPLY_TO_MESSAGE =
0x3bd4b7c2
Constants included from MediaParts
MediaParts::INPUT_MEDIA_PHOTO, MediaParts::INPUT_PHOTO
Instance Method Summary collapse
-
#initialize(peer:, photos:, message: '', reply_to: nil, silent: false) ⇒ SendMultiMedia
constructor
A new instance of SendMultiMedia.
- #serialize ⇒ Object
Methods included from MediaParts
#serialize_byte_array, #serialize_file, #serialize_held_photo, #serialize_peer, #serialize_raw, #serialize_text, #serialize_uploaded_photo
Methods included from Binary
#b_u32, #b_u64, #u32_b, #u64_b
Constructor Details
#initialize(peer:, photos:, message: '', reply_to: nil, silent: false) ⇒ SendMultiMedia
Returns a new instance of SendMultiMedia.
22 23 24 25 26 27 28 |
# File 'lib/mtproto/tl/objects/send_multi_media.rb', line 22 def initialize(peer:, photos:, message: '', reply_to: nil, silent: false) @peer = peer @photos = photos = @reply_to = reply_to @silent = silent end |
Instance Method Details
#serialize ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/mtproto/tl/objects/send_multi_media.rb', line 30 def serialize flags = 0 flags |= (1 << 0) if @reply_to flags |= (1 << 5) if @silent result = u32_b(CONSTRUCTOR) + u32_b(flags) + serialize_peer(@peer) result += u32_b(INPUT_REPLY_TO_MESSAGE) + u32_b(0) + u32_b(@reply_to) if @reply_to result += u32_b(Constructors::VECTOR) + u32_b(@photos.length) @photos.each_with_index { |photo, nth| result += serialize_single(photo, nth) } result end |