How to Create a Telegram Bot & Get your Chat ID
Last updated
Last updated
Creating a Telegram bot and extracting chat IDs are crucial steps for seamlessly integrating Telegram into your workflows. Whether you're using it to send crypto-related alerts or monitor telegram groups, this guide will walk you through the process of setting up your bot and retrieving the chat IDs needed to connect it to your workflows. To create the telegram bot, we're going to be using the BotFather which is Telegram's official bot that streamlines the creation and management of the bots on the platform.
Start a Chat with BotFather and Create Your Bot:
Open Telegram, search for @BotFather, and click the Start button to begin a conversation.
Send the command /newbot to BotFather. When prompted, provide a name for your bot (this will be the display name) and choose a username ending with "bot" (e.g., CryptoAlertBot).
Copy Your Bot’s API Token: After setting the username, BotFather will generate an API token for your bot. This token is essential for integrating your bot with Loomlay.
Start a chat with your Newly Create bot so you can then extract your Chat ID which you can reference in your workflows to instruct the bot to message you.
Now Open a browser and go to:
https://api.telegram.org/bot<YourBotToken>/getUpdates
(Replace <YourBotToken>
with your bot's token.)
Check the JSON response for the "chat"
object and Find the "id"
field—this is your chat ID. Save it for later!
Note: Telegram Private message chat IDs are numeric (e.g., 123456789
), while group chat IDs always start with a dash (e.g., -123123123
). Make sure to use the correct type of chat ID for your workflows!
Now that you've set up your Telegram bot and obtained your Bot Token and your Chat ID, you are ready to integrate it into your Loomlay Agent workflow. Start by Adding the Telegram Plugin, insert your Bot API token and hit Save, then simply reference your Chat ID in your Agent workflow instructions.