-
-
Notifications
You must be signed in to change notification settings - Fork 119
/
sendphotobuffer.json
1 lines (1 loc) · 3.35 KB
/
sendphotobuffer.json
1
[{"id":"99ee972c.22d088","type":"telegram sender","z":"84387cfd03f1f8f5","name":"","bot":"3b6bfbc0.423a04","haserroroutput":false,"outputs":1,"x":890,"y":540,"wires":[["72b71335.355a9c"]]},{"id":"58e78fc.dd0b27","type":"telegram command","z":"84387cfd03f1f8f5","name":"/fromfile","command":"/fromfile","description":"","registercommand":false,"language":"","bot":"3b6bfbc0.423a04","strict":false,"hasresponse":false,"useregex":false,"removeregexcommand":false,"outputs":1,"x":170,"y":540,"wires":[["7c8090ca.00c02"]]},{"id":"72b71335.355a9c","type":"debug","z":"84387cfd03f1f8f5","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1090,"y":540,"wires":[]},{"id":"2058d729.1a3a48","type":"function","z":"84387cfd03f1f8f5","name":"send image","func":"var buffer = msg.payload;\nvar payload = {\n content: buffer,\n message: `The requested image`,\n type : 'photo',\n chatId: msg.originalMessage.chat.id,\n chat: msg.originalMessage.chat,\n from: msg.originalMessage.from,\n message_id : msg.originalMessage.message_id\n}\n\nmsg.payload = payload;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":690,"y":540,"wires":[["99ee972c.22d088"]]},{"id":"959c0404.742708","type":"image","z":"84387cfd03f1f8f5","name":"","width":160,"data":"payload","dataType":"msg","thumbnail":false,"active":true,"outputs":1,"x":700,"y":620,"wires":[[]]},{"id":"7c8090ca.00c02","type":"file in","z":"84387cfd03f1f8f5","name":"image from file","filename":"C:\\temp\\test.jpg","format":"","chunk":false,"sendError":false,"encoding":"none","allProps":false,"x":460,"y":540,"wires":[["2058d729.1a3a48","959c0404.742708"]]},{"id":"dec15032.19344","type":"http request","z":"84387cfd03f1f8f5","name":"","method":"GET","ret":"bin","paytoqs":"ignore","url":"https://picsum.photos/200/300","tls":"","persist":false,"proxy":"","authType":"","x":470,"y":620,"wires":[["959c0404.742708","2058d729.1a3a48"]]},{"id":"db7296d38fa309cf","type":"telegram command","z":"84387cfd03f1f8f5","name":"/frominternet","command":"/frominternet","description":"","registercommand":false,"language":"","bot":"3b6bfbc0.423a04","strict":false,"hasresponse":false,"useregex":false,"removeregexcommand":false,"outputs":1,"x":190,"y":620,"wires":[["dec15032.19344"]]},{"id":"2da41ceac90ece65","type":"comment","z":"84387cfd03f1f8f5","name":"","info":"# Flow demonstrates sending a photo as buffer.\nAs few people do not know that image files can also be sent directly from within memory this example flow was created.\nThe complete description can be found here:\nhttps://core.telegram.org/bots/api#sending-files\n\n## pic1\nFile is loaded from a local file and sent as buffer.\n\n## pic2\nFile is downloaded from internet and directly sent as buffer.\n\nCredits:\nflow was derived from see also:\nhttps://discourse.nodered.org/t/taking-a-picture-and-sending-it-via-telegram/27905/4\n","x":180,"y":460,"wires":[]},{"id":"3b6bfbc0.423a04","type":"telegram bot","botname":"HeinzBot","usernames":"","chatids":"","baseapiurl":"","updatemode":"polling","pollinterval":"300","usesocks":false,"sockshost":"","socksport":"6667","socksusername":"anonymous","sockspassword":"","bothost":"","botpath":"","localbotport":"8443","publicbotport":"8443","privatekey":"","certificate":"","useselfsignedcertificate":false,"sslterminated":false,"verboselogging":false}]