Class: MTProto::TL::ReplyKeyboardForceReply

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

Constant Summary collapse

CONSTRUCTOR =
0x86b40b08

Instance Method Summary collapse

Methods included from Binary

#b_u32, #b_u64, #u32_b, #u64_b

Constructor Details

#initialize(single_use: false, selective: false, placeholder: nil) ⇒ ReplyKeyboardForceReply

Returns a new instance of ReplyKeyboardForceReply.



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

def initialize(single_use: false, selective: false, placeholder: nil)
  @single_use = single_use
  @selective = selective
  @placeholder = placeholder
end

Instance Method Details

#serializeObject



16
17
18
19
20
21
22
23
24
25
26
# File 'lib/mtproto/tl/objects/reply_keyboard_force_reply.rb', line 16

def serialize
  flags = 0
  flags |= (1 << 1) if @single_use
  flags |= (1 << 2) if @selective
  flags |= (1 << 3) if @placeholder

  result = u32_b(CONSTRUCTOR)
  result += u32_b(flags)
  result += serialize_tl_string(@placeholder) if @placeholder
  result
end