-
Notifications
You must be signed in to change notification settings - Fork 0
Telegram Bot Setup Help
Minty Trebor edited this page Apr 3, 2021
·
5 revisions
- Open Telegram (or use telegram for web on pc)
- Search for
BotFather
and open a chat (make sure you get the approved one - there seems to lots of Jokers who have setup "alternates"). - Send
/newbot
- Follow the prompts on screen to enter a name for your new Bot
- Once complete you will be given a HTTP API Token - Copy this token and keep it safe for now, you will need it later.
- Create a new group in Telegram and invite/add your new bot into the chat by its name.
- Select your bot in the group and promote them to admin so they can send messages to the group (you may alter other permissions as you see fit - providing the bot can still send messages to the group).
- Send a couple of random messages to the group to make it "active"
- Open a browser window and navigate to Hoppscotch.
- In the URL field enter
https://api.telegram.org/bot<token>/getUpdates
replacing<token>
with the api token from step 5, and click send. Keep sending until you get a response like the below (it can take a few tries with a brand new group and bot, this is why we send a couple of test msgs in step 8).
- Copy the
chat Id
(starts with-
eg-99999
) and keep it safe for now, you will need it later. - You now have everything you need to enable Telegram Event alerts from BtnCmd.
- When adding a new event in BtnCmd, select Telegram as the type and enter the API token and chat ID, and you will be up and running.
- If you want to confirm you have captured the right information you can test your token and chat id by navigating to Hoppscotch in a browser and posting
https://api.telegram.org/bot<token>/sendMessage?chat_id=<chat id>&text=TestMSG
replacing<token>
&<chat id>
with the values from steps 5 & 11 respectively. This should send a msg to the telegram group via the bot with the text "TestMSG".