Hello All,
Greetings!!
I am newbie in Node-Red(BTW GREAT tech and would like to learn it more).
I created flow today whose json is as follows.
[{"id":"e8fec1f1.d46c7","type":"tab","label":"/help function in bot.","disabled":false,"info":""},{"id":"fcb32d51.06df8","type":"telegram receiver","z":"e8fec1f1.d46c7","d":true,"name":"/help","bot":"db43ddd0.9b459","saveDataDir":"","x":90,"y":100,"wires":[["d100118a.caee5"],[]]},{"id":"d100118a.caee5","type":"function","z":"e8fec1f1.d46c7","d":true,"name":"help funct","func":"//comments here testing again...\nvar helpMsg = \"/help - shows help\\n\"\nhelpMsg += \"/foo - opens a dialog\\n\\n\\n\"\nif (msg.payload.chatId === 760176267){\n helpMsg = \"R. Singh, Welcome sir!!!! \"\n}\nelse{\nhelpMsg += \"You are welcome, \"+ msg.originalMessage.from.username;\n}\nhelpMsg += \"Your chat id is: \" + msg.payload.chatId;\nmsg.payload.content = helpMsg\nreturn msg;","outputs":1,"noerr":0,"x":280,"y":40,"wires":[["d15c5bfa.0d8738"]]},{"id":"d15c5bfa.0d8738","type":"telegram sender","z":"e8fec1f1.d46c7","d":true,"name":"response from BOT","bot":"db43ddd0.9b459","x":530,"y":40,"wires":[["d38b5da7.daa43"]]},{"id":"d38b5da7.daa43","type":"debug","z":"e8fec1f1.d46c7","d":true,"name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":730,"y":40,"wires":[]},{"id":"7a930af1.0d88d4","type":"telegram receiver","z":"e8fec1f1.d46c7","name":"/help","bot":"db43ddd0.9b459","saveDataDir":"","x":50,"y":240,"wires":[["66c5029a.4dc8cc"],[]]},{"id":"4b33c9c5.0c6038","type":"debug","z":"e8fec1f1.d46c7","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":750,"y":400,"wires":[]},{"id":"612c98a1.b75a08","type":"telegram sender","z":"e8fec1f1.d46c7","name":"","bot":"db43ddd0.9b459","x":690,"y":320,"wires":[["4b33c9c5.0c6038"]]},{"id":"66c5029a.4dc8cc","type":"function","z":"e8fec1f1.d46c7","name":"help funct1","func":"var helpMsg = \"/help - shows help\\n\"\nhelpMsg += \"/foo - opens a dialog\\n\\n\\n\"\nif (msg.payload.chatId === 760176267){\n helpMsg = \"R. Singh, Welcome sir!!!! \"\n}\nelse{\nhelpMsg += \"You are welcome, \"+ msg.originalMessage.from.username;\n}\nhelpMsg += \"Your chat id is: \" + msg.payload.chatId;\nmsg.payload.content = helpMsg\n\nreturn msg;","outputs":1,"noerr":0,"x":190,"y":320,"wires":[["a094494f.5b0ce8","612c98a1.b75a08","4f037622.b1a0c8"]]},{"id":"a094494f.5b0ce8","type":"debug","z":"e8fec1f1.d46c7","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":340,"y":400,"wires":[]},{"id":"4f037622.b1a0c8","type":"exec","z":"e8fec1f1.d46c7","command":"df / | awk 'FNR==2'","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"*nix command","x":360,"y":220,"wires":[["dc04d410.b91be8"],[],[]]},{"id":"9b4d5856.171c58","type":"debug","z":"e8fec1f1.d46c7","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":700,"y":260,"wires":[]},{"id":"dc04d410.b91be8","type":"function","z":"e8fec1f1.d46c7","name":"send output","func":"//var msg1=msg.payload;\nmsg.payload.content = msg.payload\nreturn msg;","outputs":1,"noerr":0,"x":480,"y":280,"wires":[["612c98a1.b75a08","9b4d5856.171c58"]]},{"id":"db43ddd0.9b459","type":"telegram bot","z":"","botname":"singh_is_king13","usernames":"","chatids":"","baseapiurl":"","updatemode":"polling","pollinterval":"1000","usesocks":false,"sockshost":"","socksport":"6667","socksusername":"anonymous","sockspassword":"","bothost":"","localbotport":"8443","publicbotport":"8443","privatekey":"","certificate":"","useselfsignedcertificate":false,"sslterminated":false,"verboselogging":true}]
Its recognizing my chat id by first function and providing me proper response on Telegram but NOT giving any output for df command in Telegram, though it gives me df command's output(exec toolkit) on DEBUG console. I have tried to search a lot but couldn't find solution, any help is greatly appreciated here.
Thanks,
R. Singh