windkh / node-red-contrib-telegrambot

Telegram bot nodes for node-red.
Other
262 stars 116 forks source link

editMessageCaption #183

Closed dober2 closed 3 years ago

dober2 commented 3 years ago

Hello,

i cant get this to work with the node. I follow the instruction of the api documentation, but the only thing that happens is, that node-red restarts itself. editMessageText for example works flawlessly.

windkh commented 3 years ago

I will check this ... tomorrow. Thanks for reporting

windkh commented 3 years ago

Could not reproduce it

windkh commented 3 years ago

[{"id":"ca63e749.f0e1f8","type":"telegram sender","z":"7652eee0.6d11b","name":"send initial message","bot":"5f67fb38.18d094","haserroroutput":false,"outputs":1,"x":620,"y":100,"wires":[["5c718b42.c971d4"]]},{"id":"b613abd7.8bda68","type":"telegram command","z":"7652eee0.6d11b","name":"/foo","command":"/foo","bot":"5f67fb38.18d094","strict":false,"hasresponse":false,"useregex":false,"removeregexcommand":false,"outputs":1,"x":130,"y":100,"wires":[["5be9089.9ff5ff8"]]},{"id":"5ebcc0ff.a1205","type":"telegram sender","z":"7652eee0.6d11b","name":"","bot":"5f67fb38.18d094","haserroroutput":false,"outputs":1,"x":607.2405776977539,"y":206.6966896057129,"wires":[["ffecee00.85cf3"]]},{"id":"a3dfc497.3dd828","type":"function","z":"7652eee0.6d11b","name":"modified message","func":"var messageId = context.global.messageId;\nvar chatId = context.global.chatId;\n\nvar options = {\n chat_id : chatId,\n message_id : messageId\n};\n\nmsg.payload = {\n type : 'editMessageCaption',\n content : \"The modified caption\",\n options : options,\n}\n\nreturn [ msg ];\n","outputs":"1","noerr":0,"initialize":"","finalize":"","x":327.2405776977539,"y":206.6966896057129,"wires":[["5ebcc0ff.a1205"]]},{"id":"5c718b42.c971d4","type":"function","z":"7652eee0.6d11b","name":"save IDs","func":"// We store the messageId to be able to edit this reply in the callback query. \ncontext.global.messageId = msg.payload.sentMessageId;\ncontext.global.chatId = msg.payload.chatId;\nreturn [ msg ];\n","outputs":"1","noerr":0,"initialize":"","finalize":"","x":817.9073638916016,"y":100.36340236663818,"wires":[[]]},{"id":"ffecee00.85cf3","type":"debug","z":"7652eee0.6d11b","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":827.2405776977539,"y":206.6966896057129,"wires":[]},{"id":"b1c82a24.f874f8","type":"inject","z":"7652eee0.6d11b","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"str","x":147.2405776977539,"y":206.6966896057129,"wires":[["a3dfc497.3dd828"]]},{"id":"5be9089.9ff5ff8","type":"function","z":"7652eee0.6d11b","name":"original message","func":"// content can be a file_id, url, local path...\nmsg.payload.content = 'https://www.cleverfiles.com/howto/wp-content/uploads/2018/03/minion.jpg';\nmsg.payload.type = 'photo';\nmsg.payload.caption = \"super cool\"\n\n/ type can be one of the following\nphoto\naudio\nvideo\nsticker\nvoice\ndocument\n/\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":350,"y":100,"wires":[["ca63e749.f0e1f8"]]},{"id":"5f67fb38.18d094","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}]