Telegram MT v0.1.1-alpha MTProto View Source
MTProto implementation for Elixir. Base module.
This module provides “high-level” functions for common tasks.
Link to this section Summary
Functions
Connect and create a session on the specified DC.
If dc_id
is not provided, connect to a random DC (out of the 5 available
DC.) If there is no authorization key related to the DC, the authorization
key generation will be initiated
Fetch the the contact list
Launch the Authorization Key computation sequence
Send an encrypted message to Telegram on the session sid
. Similar (alias)
to MTProto.Session.send(sid, msg, :encrypted)
Initiate the authentification procedure by sending a message to the account
linked to the provided phone
number on the session session_id
(generated with connect/1
)
Send a text message to an user/group
Initilize the connection (if not initialized yet) with default values and the version of API layer to use
Sign in given the phone number and the code received from Telegram (by SMS,
call, or via an open client). phone_code_hash
is returned in the response
to MTProto.send_code/2
and is stored in the session. You don’t need to
provide it, but you can override the phone_code_hash
stored in the
session by providing it here
Log out the user
Start the supervision tree and set default values in the registry
Link to this section Functions
Connect and create a session on the specified DC.
If dc_id
is not provided, connect to a random DC (out of the 5 available
DC.) If there is no authorization key related to the DC, the authorization
key generation will be initiated.
Returns {:ok, session_id}
.
Fetch the the contact list.
Launch the Authorization Key computation sequence.
Send an encrypted message to Telegram on the session sid
. Similar (alias)
to MTProto.Session.send(sid, msg, :encrypted)
.
Initiate the authentification procedure by sending a message to the account
linked to the provided phone
number on the session session_id
(generated with connect/1
).
Send a text message to an user/group.
session_id
dst_id
- ID (integer) of the recipient of the messagecontent
- content of the message (string)type
- type of the recipient, either an user (:contact
) or a group (:chat
)
Initilize the connection (if not initialized yet) with default values and the version of API layer to use.
Sign in given the phone number and the code received from Telegram (by SMS,
call, or via an open client). phone_code_hash
is returned in the response
to MTProto.send_code/2
and is stored in the session. You don’t need to
provide it, but you can override the phone_code_hash
stored in the
session by providing it here.
Log out the user.
Start the supervision tree and set default values in the registry.