Adding or removing users (Telegram or script node)

Dear n8n team,

I getting around how to complete my bot based on Telegram.

The thing I need to know if it is possible for a determinate telegram user code make some automation to add or remove that user from a chanel based on some condition defined by a trigger on n8n.

I’m almost sure that there is no possible to do it with the telegram node, but I’m not sure if there is someway to do it from a script node.

Any clue on how to continue with this functionality is more than welcome.

Thanks in advance.

Hi @MaaPer, the Telegram Bot API seems to only support banning and unbanning members (not adding new users) from taking a look at their documentation: Telegram Bot API.

So, the only way to achieve this seems to be mock your own Telegram client which can then perform actions as yourself (messages.addChatUser and messages.deleteChatUser seem to be the respective API methods).

I have no experience with this though, so let’s see if anyone else has tried this before. The login process seems rather complex and requires scanning a QR code from the looks of it.

Thank you for your clarification.

I will deal with the manual entry of the user un the Chanel (private one) however:

What if for example I want to quick or ban some predefined users? I see it’s not supported by node so I think I need to use some Telegram API integration, I never done that on n8n.

Do you think could be better a different approach?

Thanks in advance.

Hey @MaaPer,

The node doesn’t support that currently so you would need to use the HTTP Request node to interact with the API manually. I will add this to our internal feature tracker as an idea for the future though as I can see wanting to ban or unban users being handy.


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