windkh / node-red-contrib-telegrambot

Telegram bot nodes for node-red.
Other
266 stars 119 forks source link

Can't get callback query #165

Closed evazzoler closed 3 years ago

evazzoler commented 3 years ago

Hi, I'm trying since a week but I can't get a callback query and use the inline keyboard. I click on the keyboard and nothing happens. I tried the example code without touching the code (except the bot config). I'm using the polling connection and all works good but the callback query. Nodered is the latest version form npm. I open a issue because I'm no longer sure that may be a problem by my side.

windkh commented 3 years ago

What example did you use?

evazzoler commented 3 years ago

editinlinekeyboard.json in the examples folder (linked in the documentation)

evazzoler commented 3 years ago

Maybe because I've set "ChatIds" in the bot configuration? Whithout that I receive the callback, but it becomes a security lack...

windkh commented 3 years ago

I just ran the example and it worked... ![image](https://user-images.githubusercontent.com/10910767/112819715-2920d600-9085-11eb-9e4c-a6af0358c22c.pn

Is the callback_query node configured correctly?

windkh commented 3 years ago

I checked it out with chatId: it works

evazzoler commented 3 years ago

I confirm: without chatid it works for me, but I need chatid to be set for security reasons. With chatid set, it doesen't work.

evazzoler commented 3 years ago

NOTE: when I configure the bot without chatid, callback works but comes with a different chatid than the one of the group I'm using.

windkh commented 3 years ago

Is there a way to setup up a screen sharing session so that I can see what is going on?

evazzoler commented 3 years ago

Sure! Teamviewer? I'll contact you via private message? Now or do you prefer in a different moment?

windkh commented 3 years ago

now but only for 10min

windkh commented 3 years ago

can I send you a link? e-mail?

evazzoler commented 3 years ago

I've sent you a mail

windkh commented 3 years ago

I will have to leave for lunch now. The flow is not working as expected within groups or supergroups. It claims that the message to edit was not found. Can you confirm that the flow works when you directly talk to the bot (not within a group?)

windkh commented 3 years ago

@evazzoler The function TelegramEventNode takes the chatId from the user that initiated the callback_query. Maybe the function should also check for the sending group if there is any.

--> must be fixed Workaround: add the userIds of the chat to the allowed chatIds not only the id of the group itself.

--> the examples sometimes throw errors in super groups "message can not be edited" or "message can not be found" --> must be fixed, too

evazzoler commented 3 years ago

Thank you for your super instant (synchronous) support and for your very useful "palette"!

windkh commented 3 years ago

version 8.11.0 should fix this