rockneurotiko / ex_gram

Telegram Bot API low level API and framework
183 stars 26 forks source link

Using answer_callback: any example? #158

Closed aus70 closed 5 months ago

aus70 commented 5 months ago

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!

aus70 commented 5 months ago

I figured it out:

def handle({:callback_query, msg}, cnt) do
  answer_callback(cnt, msg, text: "yay!")
end
rockneurotiko commented 5 months ago

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