Here's a quick guide on how to create a Telegram bot that you can use for chats within NetHunt or API calls in Workflows.
Create a Telegram bot
Search for the “@Botfather” in Telegram
Start a conversation and type “/newbot”
Enter the new bot’s name (this will be a display name)
Enter bot’s username (must end with “_bot”)
Get bot’s API Token
NOTE: Bots can’t message people first, but can message channels.
How to use a bot to post on Telegram channel
Create a new channel in Telegram (you can do so by starting a new message)
Invite your bot to the Channel (search by bot’s username) and add it as an Admin
Go to https://api.telegram.org/bot{{TOKEN}}/getUpdates
Replace {{TOKEN}} with your bot’s Token in the URL (you can always get your token under chat with @Botfather), You should get the following message:{"ok":true,"result":[]}Post something to the channel with the bot (so the bot “sees” that it’s added to the channel)
Refresh the link above and it should have a list of all channels and conversations the bot participates in. You should get a similar message:
"channel_post":{"message_id":2,"sender_chat":{"id":-1001631771642,"title":"ThisIsThechannel","type":"channel"},"chat":{"id":-1001631771642,"title":"ThisIsThechannel","type":"channel"},"date":1660333732,"text":"hey","has_protected_content":true}}]}For API Call only: copy the channel’s ID to which you want to send messages via the bot. NOTE: Channel’s IDs always start with a minus symbol (-). In our case, it is: -"1001631771642",
{"id":-1001631771642,"title":"ThisIsThechannel","type":"channel"},"date":1660333732,"text":"hey","has_protected_content":true}}]}If you wish to use a bot to post on Telegram channels via API, please check out this guide.
Haven’t found the answers you’re looking for? Ask our Users Community.
