rockneurotiko/ex_gram

Using answer_callback: any example?

Closed this issue · 2 comments

Hi

I cannot figure out how to use answer_callback: the first argument is the context, but what about the second one? According to the Telegram docs the message is optional, but it's not optional in this function.

Is there any example I can use?

Thanks!

I figured it out:

def handle({:callback_query, msg}, cnt) do
  answer_callback(cnt, msg, text: "yay!")
end

Yeah, the message is mandatory because we need some of to reply (message, inline, ...) and the DSL takes and message and sets the appropiate id