skip to Main Content

I’ve been researching for a few days but can’t find guidance on a way to create multiple telegram channels at once or via automation(Shell script, python, Java etc etc)

The intent is to create multiple channels by specifying name, description & users to be added to it.

Could someone please help

2

Answers


  1. Chosen as BEST ANSWER
    TELEGRAM_USER = <Your telegram username - @my_name>
    TELEGRAM_APP_API_ID = <Get the API ID from https://my.telegram.org/apps - App api_id:>
    TELEGRAM_APP_API_HASH = <Get the API HASH from https://my.telegram.org/apps - App api_hash:>
    
    
    def create_channel_with_users(chname, descrip):
        with TelegramClient(TELEGRAM_USER, TELEGRAMA_APP_API_ID, TELEGRAMA_APP_API_HASH) as client:
            result = client(functions.channels.CreateChannelRequest(
                title=chname,
                about=descrip,
                megagroup=True
            ))
            return result
    

  2. Normal telegram bots can’t create channel or add users to channel. Only userbots can.
    Docs for creating a new channel using userbot. Adding users (without their permission/consent) is against Telegram TOS.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search