Class: MTProto::TL::GetBotCommands

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

Overview

bots.getBotCommands — fetch the bot’s commands for a given scope/language. Returns Vector<BotCommand>. Result parsing belongs to a later layer; this object only builds the request.

Constant Summary collapse

CONSTRUCTOR =
0xe34c0dd6

Instance Method Summary collapse

Methods included from Binary

#b_u32, #b_u64, #u32_b, #u64_b

Constructor Details

#initialize(scope: { type: :default }, lang_code: '') ⇒ GetBotCommands

scope: BotCommandScope hash (see BotCommandScope); defaults to default scope.



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

def initialize(scope: { type: :default }, lang_code: '')
  @scope = scope
  @lang_code = lang_code
end

Instance Method Details

#serializeObject



21
22
23
24
25
26
# File 'lib/mtproto/tl/objects/get_bot_commands.rb', line 21

def serialize
  result = u32_b(CONSTRUCTOR)
  result += BotCommandScope.serialize(@scope)
  result += serialize_tl_string(@lang_code)
  result
end