Naltox / telegram-node-bot

Node module for creating Telegram bots.
MIT License
721 stars 143 forks source link

How to reply to a inline button #63

Closed LBreda closed 8 years ago

LBreda commented 8 years ago

Hi,

I can't understand how to reply to a inline button, making the spinner disappear. In the previous version, I did it with tg.answerCallbackQuery($.id)

kamikazechaser commented 8 years ago

Following

Naltox commented 8 years ago

@LBreda @kamikazechaser You can use answerCallbackQuery method in api for that:

tg.api.answerCallbackQuery(callbackId, options)
kamikazechaser commented 8 years ago
  callback: (callbackQuery) => {
                        $.sendMessage('*Some Stuff Here*', {
                            parse_mode: 'Markdown'
                        })
                        tg.api.answerCallbackQuery(callbackId, { text: 'Showing Help', show_alert: true })

Am i doing it right? Cause it doesnt seem to be working for me

infacq commented 8 years ago

following

LBreda commented 8 years ago

@kamikazechaser What is callbackId?

kamikazechaser commented 8 years ago

@LBreda Unique identifier for the query to be answered

LBreda commented 8 years ago

@kamikazechaser try callbackQuery.id, it works for me.

kamikazechaser commented 8 years ago

Worked like a charm!

rotimi-best commented 5 years ago

Thanks very cool