Class: MTProto::TL::ChannelsUpdateUsername

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

Overview

channels.updateUsername — assign a public username to a channel/supergroup. Returns Bool.

Constant Summary collapse

CONSTRUCTOR =
0x3514b3de

Instance Method Summary collapse

Methods included from Binary

#b_u32, #b_u64, #u32_b, #u64_b

Constructor Details

#initialize(channel:, username:) ⇒ ChannelsUpdateUsername

Returns a new instance of ChannelsUpdateUsername.



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

def initialize(channel:, username:)
  @channel = channel
  @username = username
end

Instance Method Details

#serializeObject



17
18
19
20
21
22
# File 'lib/mtproto/tl/objects/channels_update_username.rb', line 17

def serialize
  result = u32_b(CONSTRUCTOR)
  result += u32_b(Constructors::INPUT_CHANNEL) + u64_b(@channel[:id]) + u64_b(@channel[:access_hash])
  result += serialize_tl_string(@username)
  result
end