[{"id":"ee5ccada.43f59","type":"telegram sender","z":"117ca2b6.9952d5","name":"","bot":"","x":570,"y":380,"wires":[[]]},{"id":"aa3d783b.53061","type":"telegram receiver","z":"117ca2b6.9952d5","name":"","bot":"","saveDataDir":"c:\\temp\\foo","filterCommands":false,"x":290,"y":420,"wires":[["3fe23b0b.35503c","ee5ccada.43f59"],[]]},{"id":"3fe23b0b.35503c","type":"debug","z":"117ca2b6.9952d5","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":560,"y":440,"wires":[]},{"id":"7b3b2aee.330974","type":"inject","z":"117ca2b6.9952d5","name":"","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":270,"y":680,"wires":[["c140074e.b4b44"]]},{"id":"c140074e.b4b44","type":"function","z":"117ca2b6.9952d5","name":"No Access","func":"// classic aproach for using context.\ncontext.global.usernames = [];\ncontext.global.chatids = [];\nreturn msg;","outputs":1,"noerr":0,"x":490,"y":680,"wires":[[]]},{"id":"cd683e65.cff7b8","type":"inject","z":"117ca2b6.9952d5","name":"","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":270,"y":720,"wires":[["72b7bffd.9a79"]]},{"id":"72b7bffd.9a79","type":"function","z":"117ca2b6.9952d5","name":"Grant access to User and chat 1","func":"// classic aproach for using context.\ncontext.global.usernames = [ \"User\" ];\ncontext.global.chatids = [ 1 ];\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":570,"y":720,"wires":[[]]},{"id":"d9d3a4c6.9ed7f","type":"change","z":"117ca2b6.9952d5","name":"Grant access to Sepp and Egon","rules":[{"t":"set","p":"usernames","pt":"global","to":"[\"Sepp\", \"Egon\"]","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":620,"wires":[[]]},{"id":"6929b4a6.06892c","type":"inject","z":"117ca2b6.9952d5","name":"","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":270,"y":620,"wires":[["d9d3a4c6.9ed7f"]]},{"id":"fa9290c0.e55dc","type":"change","z":"117ca2b6.9952d5","name":"No Access","rules":[{"t":"set","p":"usernames","pt":"global","to":"[\"Sepp\", \"Egon\"]","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":580,"wires":[[]]},{"id":"6eebcb8a.ae350c","type":"inject","z":"117ca2b6.9952d5","name":"","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":270,"y":580,"wires":[["fa9290c0.e55dc"]]},{"id":"5615bf9b.6e0f38","type":"comment","z":"117ca2b6.9952d5","name":"","info":"You can make use of the context in two ways:\n1. context.global.key = value\n2. global.set(key, value)\n\nOnly the latter one can be seen in the context browser window while the first is only stored as variable in memory.\n\nThe config node must be configured as follows:\n1. {context.global.hereyourkey} for approach one\n2. {gobal.get(\"hereyoukey\")} for approach two\n\nIf the config starts with { and ends with } the expression is evaluated as script.\n\nIn this example you can write\n{context.global.username}\n{context.global.chatids}\n\nor \n{global.get(\"usernames\")}\n{global.get(\"chatids\")}\n\nI would recommend the latter one.\n","x":260,"y":520,"wires":[]}]