Increasing your productivity with Telegram and Node.js

Lars Wächter
Feb 23 · 2 min read
Image for post
Image for post
https://unsplash.com/photos/efzwcMRM6j4

Some time ago I searched for an easy way to establish a communication channel between a mobile device and a Node.js webserver. My goal was to exchange messages over this channel and receive information about the weather, public transportation and more.

For example I send the message /train and receive a response with realtime details about train departure times of preconfigured routes. So the Node.js server receives the incoming message, processes it and sends a response back to the client.

After doing some researches I finally came up with Telegram bots since they are very easy to setup and fit perfect to my needs. Besides sending text messages, you can also share data like images or audio recordings.

First of all, what exactly is a Telegram bot? (Source)

Bots are third-party applications that run inside Telegram. Users can interact with bots by sending them messages, commands and inline requests. You control your bots using HTTPS requests to our bot API.

So you simply send a message from your phone via Telegram and your webserver receives it over Telegram’s API.

Just to name some of the things you can use your own bot for. Whether just for you or for your friends as well:

  • Gathering weather information
  • Fetching arrival / departure times of public transportation
  • Receiving tweets, news, status updates
  • Sending automated messages
  • IoT

and so much more.

One big benefit of Telegram bots is that you don’t need a public server which is accessible over an IP-address from outside the network. In my case I use a Raspberry Pi to run the Node application for example.

Since the communication takes place over the Telegram API, there’s just an internet connection required.

For interacting with it you can use a runtime environment like Node.js as I did in the example app below or any other programming languages.

Here you can find an introduction about how to interact with the API.

As I mentioned above I recently created an example app for a Telegram bot server based on Node.js. Feel free to use it for your own bot and customize it according to your wishes or contribute to it.

Let me know what you use your bot for and share your experience!

from confusion to clarity not insanity

Sign up for DDIntel

By Data Driven Investor

In each issue we share the best stories from the Data-Driven Investor's expert community. Take a look

By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy practices.

Check your inbox
Medium sent you an email at to complete your subscription.

Lars Wächter

Written by

Data Driven Investor
Lars Wächter

Written by

CS Student | Software Developer

Data Driven Investor

from confusion to clarity not insanity

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store