After creating a Slack Bot Using AWS API Gateway and AWS Lambda, I decided to port the tutorial over so that it will work for Telegram Bot too.

There are some differences between the two tutorials:

  • Telegram requires you to get an API token so that you can post the response back to the user via another request.
  • I am using Telegram /command (I might change it to be like my Slack Bot where it doesn’t need to start with a /).
  • Less options for formatting since it is just text.

You can head over to the GitHub Repo at github.com/lesterchan/telegram-bot to view the step-by-step tutorial.

There are five commands so far:

  • Singapore Bus Arrival Timings: /bus <busStopNo> <busNo>, example: /bus 1039 61
  • Singapore Haze Situation: /haze
  • Singapore Weather 3 Hour Forecast: /weather
  • IP Information: /ipinfo <ip>, example: /ipinfo 8.8.8.8
  • Social Stats Count For Links: /socialstats <url>, example: /socialstats https://lesterchan.net
Telegram Bot
Telegram Bot

See also: Slack Bot Using AWS API Gateway and AWS Lambda