Life is busy. So, why track the price of Bitcoin yourself if you can let a Telegram bot do that? In this post, we will discuss how to use a Telegram Bot to update you on the latest Bitcoin price.
What we’ll need:
a smartphone with the latest version of Telegram
a computer / Raspberry Pi with Python & Docker
We will use a simple Python script from Github. This mini project builds on the resources provided by [1], [2], and [3].
Step 1: Call the BotFather
To create bots in Telegram, we need to interact with the BotFather, the father of all bots. Simply use the embedded search of Telegram. By interacting with this special bot, we create a new bot. The command /newbot comes into play here.
The BotFather will ask for a name and a description of the bot. At the end of this exchange, the BotFather will share a bot token. Store this token at a safe place and share this token under no circumstance with anyone since this token is used to control the bot!
Step 2: Download & Docker
Next, we start up our computer (or Raspberry Pi) and pull the latest version of the Telegram tracker from Github:
git clone https://github.com/realblockjack/bitcoin-tracker
Having checked out the tracker from Github, we enter the directory and create a Docker container. The Dockerfile provides clear instructions how our container has to be constructed. This is an automated process, so all we need to do is:
After 5 steps, our Docker container has been created successfully and is ready to use! At this point, we grab the Telegram token of Step 1 and fire up Docker:
docker run -it -e BOT_TOKEN="THE-TOKEN-OF-YOUR-BOT" tracker-bot
Be careful to insert the bot token as String, as “THE-TOKEN-OF-YOUR-BOT” is nothing but a place holder.
Step 3: Time to track!
Now that the Docker container runs on our computer, we return to our phone and look for our bot. Start chatting with the bot:
/start: opens interaction with the bot
/set 3600: defines the update interval, at which the bot will update you on the latest Bitcoin price. For instance: an interval of 3600 means that the bot will text you once every hour.
Done. Now you never have to check the Bitcoin price by yourself again ;)
If you’d like to stop tracking, send a simple /unset. This will tell the bot to leave you alone!
That’s all you need to know in order to get started with your Bitcoin tracker.