How to Create an automated Telegram Bot to post in your Telegram Channel

Daily Monitor, Uganda’s leading independent daily newspaper, now has a Telegram Channel. Being fans of the popular chat app, this has not gone unnoticed by your resident geeks at Dignited. Major kudos are in order for Daily Monitor for embracing technology to diversify distribution channels for their content. Hopefully, this is the start of something glorious for media houses in Uganda and their shifting consumer base. As social media is all the rage right now, one would argue that it’s only prudent for them to adapt to consumer trends.
Matter of fact, Uganda’s tech fraternity already beat Daily Monitor to the punch. Tech256 is a Telegram Channel serving up relevant news content from Ugandan tech sites: Dignited, EnStartup, Guru8, PCTechMag and obviously Techjaja. In this dog-eat-dog world, Tech256 is rather unique. Given that Telegram has a lower adoption rate in Uganda than say, WhatsApp, it would make perfect sense to have a unified Channel.
What Daily Monitor and Tech256 did [creating a Channel, that is] isn’t as hard as it looks. Neither is it as straightforward. But not to despair, your #1 Tech consumer blog, Dignited, has come to your rescue!

How to Create a Telegram Channel

Telegram Channel

Advertisement - Continue reading below
  • Simply head over to the hamburger menu on the top left corner of your Telegram app. This applies to both smartphone and desktop apps.
  • Select ‘New Channel’ (The one with the broadcast icon).
  • Go ahead and input your Channel name and optional corresponding Channel description.
  • You can either set it as public or private, depending on your intentions. As a public channel, users may find it using their search box. A private channel, on the other hand, requires an Invite link to join.

Voila! That’s just about it.

But…you didn’t think it was that easy, did you?


Telegram could transform the business sector with Bot Payments


Telegram Channels by themselves can be a lot of work to manage. Unless you don’t intend to keep your followers for long, you need fresh content regularly streaming in. Some channels opt for forwarding content from other channels and Groups on top of creating periodical original content. As you can imagine, this is quite the labor of love. The smart move is to create your own Telegram bot to automate the process.

Creating a Telegram bot doesn’t require a degree in robotics or some such. Any couch potato can have a bot up and running in under 10 minutes or so. You don’t require any coding experience, even. I kid you not. Read on…

How to create a Telegram Bot for your Telegram Channel

Botfather

An automated Telegram Bot will fetch RSS feed from websites, and also content from Twitter and YouTube. Your bot will then automatically forward this feed to your channel once it’s published, hence keeping your channel members in the know. While this is just the tip of the iceberg as far as Telegram bot functionality is concerned, it should suffice for our purposes.


A guide to using Telegram bots


As Telegram loves to say, BotFather is the one bot to rule them all. That’s where to start when creating new bots and changing settings for existing bots.

Open BotFather 

Type the /newbot command to create a new bot. Enter a name and username to generate an authorization token for your new bot. Usernames can be between 5-32 case-insensitive characters long. As a rule, the username must end with -bot, i.e botlerbot.

Once you are done, copy the HTTP API token. e.g. something like: 435074775:AAHRQTtAOhQ1POBw9L98ru6Giek0qafTvME

Using Manybot to autopost to your Telegram Channel

Telegram bot

Now that we have a functional bot, we will use another bot to streamline the process. @Chatfuel_bot is a popular choice, but I have a personal favorite, @Manybot. Manybot will be the link between your Channel and the bot you created. In order to autopost content from your RSS feed, Twitter and YouTube, follow these steps:

  • Open Manybot
  • Select ‘Create new bot’ (the one you created earlier with Botfather)
  • Click ‘I’ve already copied the API token’ e.g 435074775:AAHRQTtAOhQ1POBw9L98ru6Giek0qafTvME
  • You can choose to write a description about your bot or skip this step.
  • Select ‘Send New Post to Subscribers.’

You will be sent to your newly created bot. From here you can send new posts to subscribers, deploy custom commands and form replies and all that. But let’s keep it simple for now. Head over to Settings at the bottom. You will see the following: Channels/Autoposting/Timezone/Cancel.

  • Click on ‘Channels‘ to start.
  • Select ‘Add Channel
  • Type Channel name/link. e.g Tech256 or https://t.me/tech256

Oops! We will hit a snag at this point. So let’s backtrack and go back to our Channel. We will set our bot as an Admin. To do this, we navigate to Channel settings, and then Administrators. We will then add our bot as Admin. Now to continue…

  • Go back to your bot and add your Channel.
  • After you are done, Select ‘Go Back
  • Select ‘Autoposting
  • Select content source i.e. Twitter(@username), YouTube channel, VK and RSS feed (e.g feed://dignited.com/feed)
  • Success!

Native Mobile apps are dead: Build a bot or Progressive Web app 


Last word:

Telegram is a dynamic feature-rich chat app to which the likes of WhatsApp are still playing catchup. The app boasts of Groups of up to 20,000 members, secret chats, Editing sent messages, a mature bot ecosystem, and more. Be sure to check out our other posts covering Telegram. That a major Ugandan media house is embracing Telegram only shows the growing user base in the country. Which is great! So, if you are already a Telegram user, join Tech256 to stay abreast with what’s new and what’s hot on the Ugandan tech scene.