Class: MTProto::TL::ChannelsGetMessages

Inherits:
Object
  • Object
show all
Includes:
Binary
Defined in:
lib/mtproto/tl/objects/channels_get_messages.rb

Constant Summary collapse

CONSTRUCTOR =
0xad8c9a23
INPUT_MESSAGE_ID =
0xa676a322

Instance Method Summary collapse

Methods included from Binary

#b_u32, #b_u64, #u32_b, #u64_b

Constructor Details

#initialize(channel:, ids:) ⇒ ChannelsGetMessages

Returns a new instance of ChannelsGetMessages.



11
12
13
14
# File 'lib/mtproto/tl/objects/channels_get_messages.rb', line 11

def initialize(channel:, ids:)
  @channel = channel
  @ids = ids
end

Instance Method Details

#serializeObject



16
17
18
19
20
21
22
# File 'lib/mtproto/tl/objects/channels_get_messages.rb', line 16

def serialize
  result = u32_b(CONSTRUCTOR)
  result += serialize_input_channel
  result += u32_b(Constructors::VECTOR) + u32_b(@ids.length)
  @ids.each { |id| result += u32_b(INPUT_MESSAGE_ID) + u32_b(id) }
  result
end