Class: MTProto::Type::RPC::Auth::SendCode
- Inherits:
-
Object
- Object
- MTProto::Type::RPC::Auth::SendCode
- Defined in:
- lib/mtproto/type/rpc/auth/send_code.rb
Constant Summary collapse
- CONSTRUCTOR =
0xa677244f
Class Method Summary collapse
Class Method Details
.build(phone_number:, api_id:, api_hash:, code_settings: {}) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/mtproto/type/rpc/auth/send_code.rb', line 13 def self.build(phone_number:, api_id:, api_hash:, code_settings: {}) raise ArgumentError, 'phone_number is required' if phone_number.nil? || phone_number.empty? query = [CONSTRUCTOR].pack('L<') query += Serializer.serialize_string(phone_number) query += Serializer.serialize_int(api_id) query += Serializer.serialize_string(api_hash) query += CodeSettings.serialize(code_settings) query end |