Telegram Inline keyboard without Command node

Thanks! I'll try that.
I was using node-red-contrib-telegrambot (node) - Node-RED when yours is base on the node-red-contrib-telegrambot-home (node) - Node-RED !!
I will check if with this other one, I have more success. Stay tuned :slight_smile:

GV

I must be dumb... but it still doesn't work.
I just created another flow:

[{"id":"c249796b.749418","type":"telegrambot-payload","z":"a18eeace.049638","name":"","bot":"53ccb726.9fe938","chatId":"12345678","sendMethod":"sendMessage","payload":"{\n    \"text\": \"door_event\"\n}","x":570,"y":220,"wires":[[]]},{"id":"c25e5e27.0e419","type":"inject","z":"a18eeace.049638","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":320,"y":220,"wires":[["c249796b.749418"]]},{"id":"53ccb726.9fe938","type":"telegrambot-config","z":0,"botname":"","usernames":"","chatIds":"","pollInterval":"1000"}]

So, I am sending the door_event string and nothing happens after the door_event message is received on telegram. :frowning:

GV

I provided the code, the instructions and a screenshot. It works.

You created another flow with an arbitrary "chatid", i hope you are using the chatid that belongs to your bot, else it will not work.

As I said I must miss something.

  1. In the telegram command node there is no place to enter a chat_id. The allowed chat_ids are listed in the configuration node. There is only the matching string to configure in that node.
  2. The other flow is to be able to easily send the "doot_event" text message. The chat_id is consistent with my bot.
    I receive the message in telegram but this message doesn't trigger the command node.

In the example you provided, the flow sending the door_event was not there. I added one to check without luck.

Yesterday evening, I looked at another way to do it. I tried the same thing with the redbot https://flows.nodered.org/node/node-red-contrib-chatbot

and here, miracle. It works. You even have a "Buttons" node making the inline_keyboard so easy to do.
:slight_smile:

Thanks for your help!!

GV

That's where you had to put it.

As long as it works for you, it is great.

Looks like that node has come on quite a bit since I last tried it. I've had a couple of attempts with it in the past and each time gave up due to complexity and lack of documentation. Hopefully all that is fixed now.

Nice to see support for Rivescript 2 and telegram webhooks. Still a bit annoying to have dozens of nodes in your palette.

I think I need to try it again.

Please keep us posted. The number of nodes was also what put me off trying it.

Compare to the other telegram-bot flavours you are flooded by many nodes. And yes, the documentation is strange. A lot of wiki pages but no really detail on how to use it.
Using a few screenshot found here and there, you eventually manage to assemble nodes. It is quite powerful and 0 javascript to write to get the eg the keyboard.

GV

That bit does sound tempting. I have implemented all the "core" functionality (input, output, images etc) re Telegram/NR except the keyboards. Mmm.

Hello,
Here is the all flow. Event for the door bell, take picture, send it, send Yes/No button. Game over!

1 Like

Hallo allemaal,

I'm trying to figure out how to listen to the button callback. I managed to set up 4 buttons but next step will be to handle the data when clicking one of them.

Can anyone help me on this?

Here is an example with the telegram received node:

[{"id":"56f5732a.36cd0c","type":"chatbot-telegram-receive","z":"4b860295.c5a50c","bot":"24a3f1a2.06f69e","botProduction":"f6f1fe57.409e5","x":215,"y":2800,"wires":[["5da7161.f2852e8"]],"l":false},{"id":"5da7161.f2852e8","type":"switch","z":"4b860295.c5a50c","name":"Message","property":"payload.content","propertyType":"msg","rules":[{"t":"eq","v":"light","vt":"str"},{"t":"eq","v":"door","vt":"str"},{"t":"regex","v":"music.*","vt":"str","case":false},{"t":"eq","v":"heat","vt":"str"},{"t":"eq","v":"alarm","vt":"str"},{"t":"regex","v":"velux.*","vt":"str","case":false},{"t":"regex","v":"[0-9][0-9][0-9][0-9][0-9][0-9]","vt":"str","case":false}],"checkall":"true","repair":false,"outputs":7,"x":320,"y":2800,"wires":[[],[],[],[],[],[],[]]},{"id":"24a3f1a2.06f69e","type":"chatbot-telegram-node","z":"","botname":"@MyChatDev","usernames":"","providerToken":"","polling":"1000","store":"","log":"","parseMode":"","debug":false,"webHook":"","connectMode":"polling"},{"id":"f6f1fe57.409e5","type":"chatbot-telegram-node","z":"","botname":"@MyChatProd","usernames":"","providerToken":"","polling":"1000","store":"","log":"","parseMode":"","debug":false,"webHook":"","connectMode":"polling"}]

Which is:

And then out of the switch node, you do what you want based on the answer.

GV

Hello greengolfer,

Thanks for the reply, I imported your flow but it seems you are using a different chatbot? I'm using node-red-contrib-telegrambot which is also mentioned in the start post of this thread. The documentation tells me node-red-contrib-telegrambot should be able to handle callbacks, but I'm looking for an example :slight_smile:

Never mind, I figured it out. The manual showed a callback_query node, but couldn't find it on the palette. In the end it seemed that when I drag an event node to the flow, the name changes to callback_query. Using a debug node to monitor the output it was a piece of cake to get it going. :slight_smile:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.