Class: MTProto::TL::GetHistory

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

Constant Summary collapse

CONSTRUCTOR =
0x4423e6c5

Instance Method Summary collapse

Methods included from Binary

#b_u32, #b_u64, #u32_b, #u64_b

Constructor Details

#initialize(peer:, offset_id: 0, offset_date: 0, add_offset: 0, limit: 100, max_id: 0, min_id: 0) ⇒ GetHistory

Returns a new instance of GetHistory.



10
11
12
13
14
15
16
17
18
# File 'lib/mtproto/tl/objects/get_history.rb', line 10

def initialize(peer:, offset_id: 0, offset_date: 0, add_offset: 0, limit: 100, max_id: 0, min_id: 0)
  @peer = peer
  @offset_id = offset_id
  @offset_date = offset_date
  @add_offset = add_offset
  @limit = limit
  @max_id = max_id
  @min_id = min_id
end

Instance Method Details

#serializeObject



20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/mtproto/tl/objects/get_history.rb', line 20

def serialize
  result = u32_b(CONSTRUCTOR)
  result += serialize_input_peer
  result += u32_b(@offset_id)
  result += u32_b(@offset_date)
  result += u32_b(@add_offset)
  result += u32_b(@limit)
  result += u32_b(@max_id)
  result += u32_b(@min_id)
  result += u64_b(0) # hash
  result
end