Class: MTProto::TL::GetBotCallbackAnswer

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

Overview

messages.getBotCallbackAnswer — the press itself: the user client invokes this with the button’s callback data; the server delivers an updateBotCallbackQuery to the bot and blocks until the bot answers (or times out), then returns messages.botCallbackAnswer.

Constant Summary collapse

CONSTRUCTOR =
0x9342ca07

Instance Method Summary collapse

Methods included from Binary

#b_u32, #b_u64, #u32_b, #u64_b

Constructor Details

#initialize(peer:, msg_id:, data: nil, game: false) ⇒ GetBotCallbackAnswer

Returns a new instance of GetBotCallbackAnswer.



14
15
16
17
18
19
# File 'lib/mtproto/tl/objects/get_bot_callback_answer.rb', line 14

def initialize(peer:, msg_id:, data: nil, game: false)
  @peer = peer
  @msg_id = msg_id
  @data = data
  @game = game
end

Instance Method Details

#serializeObject



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

def serialize
  flags = 0
  flags |= (1 << 0) if @data
  flags |= (1 << 1) if @game

  result = u32_b(CONSTRUCTOR)
  result += u32_b(flags)
  result += serialize_input_peer
  result += u32_b(@msg_id)
  result += serialize_tl_bytes(@data) if @data
  result
end