Skip to content

How to work with InlineKeyboardMarkup? #149

Answered by visciang
MLNW asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @MLNW

Have a look here https://visciang.github.io/telegram/readme.html#sendmessage-with-keyboard
Just use the json object "facility" (no need to serialize the object yourself) and use the correct reply_markup object schema (keyboard_markup = %{one_time_keyboard: ..., keyboard: ...})

About errors: we are just send request to the telegram server and you get back a reply from them, just look at the response.
But consider that they will apply the robustness principle, so if you send by mistake extra info that won't give any error.

IE:

iex(5)> Telegram.Api.request(token, "sendMessage", chat_id: 0, text: "text")
{:error, "Bad Request: chat not found"}

iex(6)> Telegram.Api.request(token, "ge…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@MLNW
Comment options

@MLNW
Comment options

Answer selected by MLNW
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants