-
Notifications
You must be signed in to change notification settings - Fork 13
Install Telegram Bot
- Install telegram on desktop
- Create a telegram account (requires a phone number)
So this setup goes through setting up telegram bot and private channel the bot can use. I don't support public channels, since anyone can access public channels in telegram.
-
After you've installed telegram, start by initiating a conversation with the "BotFather" https://t.me/botfather
-
If you've installed telegram at this point you should get the following option in your browser
- You should see below chat window appear in telegram desktop, now we can start talking to the BotFather
- Type /start and hit enter. Then type /newbot and hit enter
-
In above image I grayed out the your new bots url and token, save these items aside, we will need them shortly.
-
So telegram doesn't have same security for bots as slack or discord. Anyone in theory can message your bot, so the botdarr application only sends responses to channels you configured in your properties file. This prevents people from trying to use your bot if they guess the bots url or someone gave it out.
-
Next lets create a private channel, goto the top left of telegram and click Settings button
- Then click "New Channel" and enter your new channel name
- Then set the channel privacy to "Private Channel" save the invite link aside.
- Next you have the option to add any members, you will be automatically added as an administrator. But here you can pick your bot as a user to add. Bot's can only be added as administrators, so telegram will force you to make the bot an admin. The bot only needs ability to post messages
- You're almost done, now we need to get the private channels id. Unfortunately there is nothing in there api that supports getting a private channel id via channel name without sending a message to the channel. So to get the channel id, type any message in telegram. Then right click the message->copy post link
- Paste the url somewhere, it should look like below. The channel id is between c/ and /post id (which in below example is 2)
-
Save this id, you will use it when you setup properties file
-
That's it, you're done setting up the telegram bot