Module pe4kin_types

Helpers to work with telegram data types.

Copyright © (C) 2016, Sergey Prokhorov

Authors: Sergey Prokhorov (me@seriyps.ru).

Description

Helpers to work with telegram data types.

Data Types

update_type()

update_type() = message | edited_message | channel_post | edited_channel_post | inline_query | chosen_inline_result | callback_query | shipping_query | pre_checkout_query

Function Index

chat_id/2
command_get_args/3Parses not more than NArgs command arguments.
message_command/2Returns only 1st command.
message_type/1Detect message type.
object/2
update_type/1Detect incoming update type.
user/2gets User structure from an update.

Function Details

chat_id/2

chat_id(UpdType::update_type(), Update::pe4kin:update()) -> {ok, pe4kin:chat_id()} | undefined

command_get_args/3

command_get_args(NArgs::non_neg_integer() | '*', Command::pe4kin:json_object(), Message::pe4kin:json_object()) -> [binary()]

Parses not more than NArgs command arguments. If NArgs is '*', parses all arguments (until meet the end of the message or new line).

message_command/2

message_command(BotName::pe4kin:bot_name(), X2::pe4kin:json_object()) -> {Cmd::binary(), BotName::binary(), SentToMe::boolean(), Command::pe4kin:json_object()}

Returns only 1st command

message_type/1

message_type(X1) -> any()

Detect message type

object/2

object(Type::update_type(), Update::pe4kin:update()) -> {ok, pe4kin:json_object()} | error

update_type/1

update_type(X1::pe4kin:json_object()) -> update_type() | undefined

Detect incoming update type

user/2

user(Type::update_type(), Update::pe4kin:update()) -> {ok, pe4kin:json_object()} | error

gets User structure from an update


Generated by EDoc