forked from windkh/node-red-contrib-telegrambot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
inlinekeyboard.json
1 lines (1 loc) · 2.26 KB
/
inlinekeyboard.json
1
[{"id":"5fb5e66e.d8ebe8","type":"debug","z":"1f6b5f62.c79df1","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":350,"y":40,"wires":[]},{"id":"ebf5edfa.8c331","type":"catch","z":"1f6b5f62.c79df1","name":"","scope":null,"x":100,"y":40,"wires":[["5fb5e66e.d8ebe8"]]},{"id":"65b3afb9.8d92","type":"telegram event","z":"1f6b5f62.c79df1","name":"","bot":"45ef79a0.ed7688","event":"callback_query","autoanswer":true,"x":120,"y":100,"wires":[["e74381b8.86275"]]},{"id":"3aabea8a.3ea5e6","type":"telegram sender","z":"1f6b5f62.c79df1","name":"show inline keyboard","bot":"45ef79a0.ed7688","x":660,"y":180,"wires":[[]]},{"id":"40d82a14.cf5f64","type":"function","z":"1f6b5f62.c79df1","name":"inline keyboard message","func":"context.global.keyboard = { pending : true };\n\nvar opts = {\n reply_to_message_id: msg.payload.messageId,\n reply_markup: JSON.stringify({\n \"inline_keyboard\": [[\n {\n \"text\": \"Yes\",\n \"callback_data\": \"FOO YES\" \n }, \n {\n \"text\": \"No\",\n \"callback_data\": \"FOO NO\" \n }]\n ]\n })\n};\n\nmsg.payload.content = 'Are you sure?';\nmsg.payload.options = opts;\n\nreturn [ msg ];\n","outputs":"1","noerr":0,"x":390,"y":180,"wires":[["3aabea8a.3ea5e6"]]},{"id":"3c9c3fe.d673ac","type":"telegram command","z":"1f6b5f62.c79df1","name":"/foo","command":"/foo","bot":"45ef79a0.ed7688","x":90,"y":180,"wires":[["40d82a14.cf5f64"],[]]},{"id":"e74381b8.86275","type":"function","z":"1f6b5f62.c79df1","name":"set answer options","func":"var show_alert = false; // you can set this to true to open a dialog with the answer in the client.\n\n// msg.payload.content contains the callback data from the keyboard.\n// You may change this value here.\nmsg.payload.options = show_alert;\n\nreturn [ msg ];\n","outputs":"1","noerr":0,"x":370,"y":100,"wires":[["a8e26f88.1e892"]]},{"id":"a8e26f88.1e892","type":"telegram sender","z":"1f6b5f62.c79df1","name":"answer callback query","bot":"45ef79a0.ed7688","x":660,"y":100,"wires":[[]]},{"id":"45ef79a0.ed7688","type":"telegram bot","z":"","botname":"HeinzBot","usernames":"","chatids":"","baseapiurl":"","pollinterval":""}]