Class: MTProto::TL::GetAccessSettings

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

Constant Summary collapse

CONSTRUCTOR =
0x213853a3
INPUT_USER =
0xf21158c6
INPUT_USER_SELF =
0xf7c1b13f

Instance Method Summary collapse

Methods included from Binary

#b_u32, #b_u64, #u32_b, #u64_b

Constructor Details

#initialize(bot:) ⇒ GetAccessSettings

bot: { id:, access_hash: } or { type: :self }



13
14
15
# File 'lib/mtproto/tl/objects/get_access_settings.rb', line 13

def initialize(bot:)
  @bot = bot
end

Instance Method Details

#serializeObject



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

def serialize
  result = u32_b(CONSTRUCTOR)
  result += if @bot[:type] == :self
              u32_b(INPUT_USER_SELF)
            else
              u32_b(INPUT_USER) + u64_b(@bot[:id]) + u64_b(@bot[:access_hash] || 0)
            end
  result
end