Telegram TL v0.2.1 TL.Schema
Parse and search the MTProto TL-schema (See core.telegram.org/schema/mtproto) and the API TL-schema (See core.telegram.org/schema for API layer 23).
Summary
Functions
Returns the Telegram API TL-schema
Return the version of the API layer used
Search descriptors in the schema(s)
Search in a specific schema
Returns the MTProto TL-schema
Functions
Returns the Telegram API TL-schema.
Example
iex> TL.Schema.api
%{"constructors" => [%{"id" => "-1132882121", "params" => [],
"predicate" => "boolFalse", "type" => "Bool"}, ...], ...}
Search descriptors in the schema(s)
key
: field namevalue
: field value
Examples
iex> TL.Schema.search "method", "messages.setTyping"
{:match,
[%{"id" => "-1551737264", "method" => "messages.setTyping",
"params" => [%{"name" => "peer", "type" => "InputPeer"},
%{"name" => "action", "type" => "SendMessageAction"}], "type" => "Bool"}]}
iex> TL.Schema.search "id", "-1551737264"
{:match,
[%{"id" => "-1551737264", "method" => "messages.setTyping",
"params" => [%{"name" => "peer", "type" => "InputPeer"},
%{"name" => "action", "type" => "SendMessageAction"}], "type" => "Bool"}]}
iex> TL.Schema.search "method", "unknown_method"
{:nothing, nil}
iex> TL.Schema.search "method_or_predicate", "messages.sendMedia" # to search in both method and predicates
{:match, ...}
Search in a specific schema.
key
- example :"predicate"
value
- example :"ping"
schema
- schema to search into, either:tl
or:api
.