0

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

usert4jju7
  • 1,653
  • 3
  • 27
  • 59

2 Answers2

1

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.

0
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
usert4jju7
  • 1,653
  • 3
  • 27
  • 59