Class: MTProto::TL::MessagesAddChatUser

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

Overview

messages.addChatUser — add a user to a basic group chat. Returns messages.InvitedUsers.

Constant Summary collapse

CONSTRUCTOR =
0xcbc6d107
INPUT_USER =
0xf21158c6

Instance Method Summary collapse

Methods included from Binary

#b_u32, #b_u64, #u32_b, #u64_b

Constructor Details

#initialize(chat_id:, user:, fwd_limit: 50) ⇒ MessagesAddChatUser

Returns a new instance of MessagesAddChatUser.



13
14
15
16
17
# File 'lib/mtproto/tl/objects/messages_add_chat_user.rb', line 13

def initialize(chat_id:, user:, fwd_limit: 50)
  @chat_id = chat_id
  @user = user
  @fwd_limit = fwd_limit
end

Instance Method Details

#serializeObject



19
20
21
22
23
24
# File 'lib/mtproto/tl/objects/messages_add_chat_user.rb', line 19

def serialize
  u32_b(CONSTRUCTOR) +
    u64_b(@chat_id) +
    u32_b(INPUT_USER) + u64_b(@user[:id]) + u64_b(@user[:access_hash] || 0) +
    u32_b(@fwd_limit)
end