I've setup a generic flow that saves your chat id in flow context (though you don't need to store it there once you have your chat id - you can hard code it in the function node)
The way this demo works: Send /setup
to your chat and the bot will intercept the message, store the chat ID then you can press the injects to send a message any time...
Flow...
[{"id":"b3f037c4ec8c4553","type":"telegram command","z":"6c2cb5231a8080e7","name":"/setup","command":"/setup","description":"","registercommand":false,"language":"","bot":"fa7a9376.321ce","strict":false,"hasresponse":false,"useregex":false,"removeregexcommand":false,"outputs":1,"x":270,"y":180,"wires":[["15efa9a65441eee0"]]},{"id":"15efa9a65441eee0","type":"change","z":"6c2cb5231a8080e7","name":"save chatId","rules":[{"t":"set","p":"chatId","pt":"flow","to":"payload.chatId","tot":"msg"},{"t":"set","p":"chatId","pt":"msg","to":"payload.chatId","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":510,"y":180,"wires":[["4eb6f521ca3b440a"]]},{"id":"265dead2b376b173","type":"inject","z":"6c2cb5231a8080e7","name":"","props":[{"p":"chatId","v":"chatId","vt":"flow"},{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"Your heating is off","payloadType":"str","x":330,"y":300,"wires":[["ee79361b7ca25a1a"]]},{"id":"ca7e59b37107dcf8","type":"telegram sender","z":"6c2cb5231a8080e7","name":"","bot":"fa7a9376.321ce","haserroroutput":false,"outputs":1,"x":970,"y":300,"wires":[[]]},{"id":"ee79361b7ca25a1a","type":"function","z":"6c2cb5231a8080e7","name":"send markdown","func":"// prepare message content\nvar content =\n `\n*System message...*\n\n_${msg.payload}_\n\n*server time...*\n\\`${new Date().toString()}\\`\n\n`;\n\n// prepare telegram\nmsg.payload = { \n chatId: msg.chatId, \n type: 'message', \n content: content \n};\n\n// activate markdown\nmsg.payload.options = {\n disable_web_page_preview: true,\n parse_mode: \"Markdown\"\n};\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":520,"y":300,"wires":[["ca7e59b37107dcf8"]],"info":"## New message\n\nHello *markdown* formatted messages!'\n\nwith `inline` code\n\n> and quote\n>> nested\n\n\\`\\`\\`\nvar code = \"cool\";\n\\`\\`\\`\n\n| table | data |\n|---|---|\n| 1 | fred |\n| 2 | bob |\n\n_Italic_ **bold** "},{"id":"517e109eb7d6a9df","type":"function","z":"6c2cb5231a8080e7","name":"prep msg with image","func":"\nvar imgBase64 = msg.payload;\nvar pos = imgBase64.indexOf(\"base64,\");\nimgBase64 = imgBase64.substr(pos + 7);\nvar imgData = Buffer.from(imgBase64, \"base64\");\n\nmsg.payload = {\n content: imgData,\n caption: `An Image for you`,\n type: 'photo',\n chatId: msg.chatId \n}\nmsg.payload.options = { parse_mode: \"Markdown\" };\n\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":540,"y":360,"wires":[["ca7e59b37107dcf8"]],"info":"## New message\n\nHello *markdown* formatted messages!'\n\nwith `inline` code\n\n> and quote\n>> nested\n\n\\`\\`\\`\nvar code = \"cool\";\n\\`\\`\\`\n\n| table | data |\n|---|---|\n| 1 | fred |\n| 2 | bob |\n\n_Italic_ **bold** "},{"id":"d4d893e0ba4251e0","type":"inject","z":"6c2cb5231a8080e7","name":"send an image","props":[{"p":"payload"},{"p":"chatId","v":"chatId","vt":"flow"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"data:image/gif;base64,R0lGODlhPQBEAPeoAJosM//AwO/AwHVYZ/z595kzAP/s7P+goOXMv8+fhw/v739/f+8PD98fH/8mJl+fn/9ZWb8/PzWlwv///6wWGbImAPgTEMImIN9gUFCEm/gDALULDN8PAD6atYdCTX9gUNKlj8wZAKUsAOzZz+UMAOsJAP/Z2ccMDA8PD/95eX5NWvsJCOVNQPtfX/8zM8+QePLl38MGBr8JCP+zs9myn/8GBqwpAP/GxgwJCPny78lzYLgjAJ8vAP9fX/+MjMUcAN8zM/9wcM8ZGcATEL+QePdZWf/29uc/P9cmJu9MTDImIN+/r7+/vz8/P8VNQGNugV8AAF9fX8swMNgTAFlDOICAgPNSU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ADj5AChSIQW6gu10bE/JG2VnCZGfo4R4d0sdQoBAHhPjhIB94v/wRoRKQWGRHgrhGSQJxCS+0pCZbEhAAOw==","payloadType":"str","x":320,"y":360,"wires":[["517e109eb7d6a9df"]]},{"id":"b4ab1552a8920265","type":"inject","z":"6c2cb5231a8080e7","name":"","props":[{"p":"chatId","v":"chatId","vt":"flow"},{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"Person detected in garden","payloadType":"str","x":290,"y":240,"wires":[["4bfd3e7453d7b94b"]]},{"id":"4bfd3e7453d7b94b","type":"function","z":"6c2cb5231a8080e7","name":"send message","func":"var content = msg.payload;\n\nmsg.payload = { \n chatId: msg.chatId, \n type: 'message', \n content: msg.payload \n};\n\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":520,"y":240,"wires":[["ca7e59b37107dcf8"]],"info":"## New message\n\nHello *markdown* formatted messages!'\n\nwith `inline` code\n\n> and quote\n>> nested\n\n\\`\\`\\`\nvar code = \"cool\";\n\\`\\`\\`\n\n| table | data |\n|---|---|\n| 1 | fred |\n| 2 | bob |\n\n_Italic_ **bold** "},{"id":"8bfd14800c0d3708","type":"http request","z":"6c2cb5231a8080e7","name":"","method":"GET","ret":"bin","paytoqs":"ignore","url":"https://picsum.photos/200/300","tls":"","persist":false,"proxy":"","authType":"","x":610,"y":420,"wires":[["f4170678b5812dab"]]},{"id":"f4170678b5812dab","type":"function","z":"6c2cb5231a8080e7","name":"send picture","func":"msg.payload = {\n content: msg.payload,\n caption: `A random image`,\n type : 'photo',\n chatId: msg.chatId,\n}\nmsg.payload.options = { parse_mode : \"Markdown\" };\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":790,"y":420,"wires":[["ca7e59b37107dcf8"]]},{"id":"49fdf0a64632d40d","type":"inject","z":"6c2cb5231a8080e7","name":"send random image from internet","props":[{"p":"payload"},{"p":"chatId","v":"chatId","vt":"flow"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":370,"y":420,"wires":[["8bfd14800c0d3708"]]},{"id":"4eb6f521ca3b440a","type":"function","z":"6c2cb5231a8080e7","name":"send message","func":"var content = \"Your chatId has been set - messages should now be sent to this chat\"\n\nmsg.payload = { \n chatId: msg.chatId, \n type: 'message', \n content: content\n};\n\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":700,"y":180,"wires":[["ca7e59b37107dcf8","290de46f5c5e8734"]],"info":"## New message\n\nHello *markdown* formatted messages!'\n\nwith `inline` code\n\n> and quote\n>> nested\n\n\\`\\`\\`\nvar code = \"cool\";\n\\`\\`\\`\n\n| table | data |\n|---|---|\n| 1 | fred |\n| 2 | bob |\n\n_Italic_ **bold** "},{"id":"290de46f5c5e8734","type":"debug","z":"6c2cb5231a8080e7","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1000,"y":180,"wires":[]},{"id":"fa7a9376.321ce","type":"telegram bot","botname":"my bot","usernames":"","chatids":"","baseapiurl":"","updatemode":"polling","pollinterval":"","usesocks":false,"sockshost":"","socksport":"","socksusername":"","sockspassword":"","bothost":"","botpath":"","localbotport":"","publicbotport":"","privatekey":"","certificate":"","useselfsignedcertificate":false,"sslterminated":false,"verboselogging":false}]
PS: Don't forget your select your BOT in the telegram nodes after importing
Result...