How to integrate Telegram
Integrating Hummingbot with Telegram Messenger allows you to get real-time updates and issue commands to your trading bot from any device where you have Telegram installed.
Whether you are running Hummingbot in the cloud or on your local machine, you can use Telegram to monitor and control bots from wherever you are!
Note: Make sure to install Telegram on your system before setting up your Telegram Bot. If not, you can download Telegram for Windows/MAC/Linux and install.
To create a Telegram bot that integrates with your Hummingbot deployment:
Create the Bot
- Click this link to launch the official BotFather bot, a Telegram bot that helps you create and manage Telegram bots: https://telegram.me/BotFather.
- In Telegram, go to the newly-created BotFather chat pane, and click
/newbotto create a bot.
- Enter a name for your bot, the title of the bot in Telegram (e.g.
- Enter a unique ID that ends with the word
Take note of the Telegram token that is needed for step 9.
- Click the link to your new bot in the message above launch it:
t.me/<YOUR BOT NAME>. Click
/startto start the bot.
Get your Telegram ID
Click this following to launch userinfobot, a Telegram bot that helps you retrieve your Telegram ID: https://telegram.me/userinfobot.
In Telegram, go to the newly-created userinfobot chat pane, and click
/start. Take note of the
Idparameter that is needed for step 9.
Configure the Telegram Settings in Hummingbot
- In the directory where you have installed Hummingbot, go to your global configuration file
conf/conf_global.ymland edit the following parameters inside the file:
telegram_enabled: true telegram_token: <TELEGRAM TOKEN FROM STEP 1> telegram_chat_id: <TELEGRAM ID FROM STEP 2>
Locating your global configuration:
- Installed from source:
- Installed via Docker:
hummingbot_filesis the default name of the parent directory. This can be different depending on the setup when the instance was created.
- Installed via Binary (Windows):
- Installed via Binary (MacOS):
- Installed from source:
Alternatively, you can also configure your Telegram bot inside the Hummingbot client by using the following commands:
config telegram_enabled config telegram_token config telegram_chat_id
- You can now startup Hummingbot and confirm that the integration is properly configured. If Hummingbot was running when you configured telegram, make sure to
exitand restart Hummingbot to reload the telegram configurations.
Use your Telegram Bot
Before you start Hummingbot, make sure that the Telegram bot is live. If so, you should see a chat pane with your bot's name in Telegram.
- Start hummingbot as you would normally. Telegram will be connected as soon as you enter
startin your hummingbot CLI window.Messages are synchronized in real-time between the Telegram bot and the actual Hummingbot instance running. For example, you can use commands such as
historyto monitor the bot's performance,
configshows bot current configurations and you can use
stopto control the bot.
Tip: If you are running multiple bots with telegram enabled, you can use same telegram chat id with different telegram tokens from each bot you created to control all of them. You can also enable telegram chat folders to organize your bots. Visit telegram blog page for more info.