-2

I have written a website which links to a Telegram channel and provides "subscribers" with alerts when certain criteria are met. This is all fine. This works. I use the botfather and a bot however it's a pain to administer.

Every week the telegram channel changes, due to subscriptions only lasting a week.

So once a week:

  1. a new channel is created,
  2. the bot is added into the new channel as an administrator
  3. the channel URL is entered into the bot code

Are there any methods I can use to automate this?

I'd preferably like a button which would create the channel, and add the bot without any user input. It would need to return the channel URL so I could update the message sending code.

I'm using this Gitlab package https://github.com/TelegramBot/Api

I'm just wondering if there are better ways of doing what I'm doing so I don't need to do the manual grunt work myself.

Thanks in advance, Chris

Sayed Mohd Ali
  • 2,156
  • 3
  • 12
  • 28
Chris
  • 546
  • 1
  • 4
  • 18
  • use [Signal](https://signal.org/) over Telegram. Telegram is [not secue](https://security.stackexchange.com/questions/49782/is-telegram-secure/49802#49802). – Martin Jul 12 '19 at 10:56
  • Telegram is the clients choice @martin - I can't change that – Chris Jul 13 '19 at 17:01

1 Answers1

0

You'll have to use an MTPROTO library to automate those steps because telegram bot api doesn't support them. Search for MTPROTO Client API Library.

You better go with Td-Lib

  1. Create Channel
  2. Add User to Channel
  3. Export Channel Invite Link

Then you can save invite link in a database where the bot can access.

Ali Padida
  • 1,763
  • 1
  • 16
  • 34