Module pe4kin

Main API module.

Copyright © (C) 2016, Sergey Prokhorov

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

Description

Main API module.

Data Types

bot_name()

bot_name() = binary()

bot name without leading "@"

chat_id()

chat_id() = integer()

=< 52 bit

json_array()

json_array() = [json_value()]

json_literal()

json_literal() = null | true | false | json_string() | json_number()

json_number()

json_number() = integer() | float()

json_object()

json_object() = #{json_string() => json_value()}

json_string()

json_string() = atom() | binary()

json_value()

json_value() = json_literal() | json_object() | json_array()

update()

update() = json_object()

Function Index

answer_callback_query/2
api_call/2
api_call/3
download_file/2
forward_message/2
get_env/1
get_env/2
get_file/2
get_me/1
get_updates_sync/2 This API is for testing purposes.
get_user_profile_photos/2
kick_chat_member/2
launch_bot/3
send_audio/2
send_big_text/2Sends text message and if it's too big for a single message, splits it to many.
send_chat_action/2
send_contact/2
send_document/2
send_location/2
send_message/2
send_photo/2
send_sticker/2
send_venue/2
send_video/2
send_voice/2
unban_chat_member/2

Function Details

answer_callback_query/2

answer_callback_query(Bot, Req) -> any()

api_call/2

api_call(Bot::bot_name(), Method::binary()) -> {ok, json_value()} | {error, Type::atom(), term()}

api_call/3

api_call(Bot::bot_name(), Method::binary(), Payload::pe4kin_http:req_body() | undefined) -> {ok, json_value()} | {error, Type::atom(), term()}

download_file/2

download_file(Bot::bot_name(), X2::json_object()) -> {ok, Headers::[{binary(), binary()}], Body::binary()}

forward_message/2

forward_message(Bot, Req) -> any()

get_env/1

get_env(Key::any()) -> {ok, any()}

get_env/2

get_env(Key::any(), Default::any()) -> any()

get_file/2

get_file(Bot, Req) -> any()

get_me/1

get_me(Bot) -> any()

get_updates_sync/2

get_updates_sync(Bot, Opts) -> any()

This API is for testing purposes

get_user_profile_photos/2

get_user_profile_photos(Bot, Req) -> any()

kick_chat_member/2

kick_chat_member(Bot, Req) -> any()

launch_bot/3

launch_bot(Bot, Token, Opts) -> any()

send_audio/2

send_audio(Bot, Req) -> any()

send_big_text/2

send_big_text(Bot, Message) -> any()

Sends text message and if it's too big for a single message, splits it to many. It's not a good idea to add extra fields like online keyboards, because they will be attached to every message

send_chat_action/2

send_chat_action(Bot, Req) -> any()

send_contact/2

send_contact(Bot, Req) -> any()

send_document/2

send_document(Bot, Req) -> any()

send_location/2

send_location(Bot, Req) -> any()

send_message/2

send_message(Bot, Message) -> any()

send_photo/2

send_photo(Bot, Req) -> any()

send_sticker/2

send_sticker(Bot, Req) -> any()

send_venue/2

send_venue(Bot, Req) -> any()

send_video/2

send_video(Bot, Req) -> any()

send_voice/2

send_voice(Bot, Req) -> any()

unban_chat_member/2

unban_chat_member(Bot, Req) -> any()


Generated by EDoc