Telegram admins

I am trying to create a command that only responds to administrators.
how should i set the command to get an array of all admin?

The /command node should return the property this will be who sent the command use it to compare it to the admins id to filter /commands for others.

To use the getChatAdministrators method, you can send a http request as below

[{"id":"b1175572.28c0d8","type":"inject","z":"c791cbc0.84f648","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":340,"wires":[["5a160730.12f4f8"]]},{"id":"5a160730.12f4f8","type":"http request","z":"c791cbc0.84f648","name":"","method":"GET","ret":"obj","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","authType":"","x":350,"y":320,"wires":[["e68bb3e2.78de2"]]},{"id":"e68bb3e2.78de2","type":"debug","z":"c791cbc0.84f648","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":600,"y":340,"wires":[]}]

should return


can I get the admin list only through the webhook?

I have not seen any way to get it from the telegram node But others may know differently. If there was the telegram node would use a http call or web sockets to do the same thing.

You would only need to do the http call once a day (or similar) to store admin id's

to which address should I bind the token to get the webhook for node-red?

Look in the http request node the full url is there. Just change the bot secret key and the chat_id.

Yes, thank you. It's working. I just have to filter the playolad. I was expecting an array.

Try this JSONata expression in a change node, it should return an array of id's
Set msg.what_ever
to J:


I tested the proposed solution but it had no result

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.