A Serverless Telegram Bot using Python that's based in Singapore
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
LICENSE
README.md
lambda_weather_bot.py
requirements.txt

README.md

@seng_bot source code

This is the source code to @seng_bot, an active Telegram Bot that is hosted on AWS Lambda and Amazon API Gateway.

Its current functions are to:

  • Return weather information based on a requestor's current location
  • Return dengue cluster information based on a requestor's current location

If you want to deploy this bot on your own, you can follow this guide which should provide a rough guide on deploying this app.

Prerequisite

  1. Make sure you have already created a Telegram Bot

Pre-deployment checklist

  1. Make sure you run
$ pip install -r requirements.txt -t .
# this is to make sure the modules will be able to be used by AWS Lambda
  1. Add your telegram bot API key into a .env file.

Your .env file should look like:

# .env
TELEGRAM_API_KEY=<APIKEY>
  1. Zip up the files
$ zip -r py.zip *
$ zip -j py.zip .env
  1. Upload the zip file into AWS Lambda

  2. Setup your update-hook

# INVOKE_URL being your Amazon API Gateway Production URL
# ACCESS_TOKEN being your Telegram Bot API Key
$ curl --data "url=<INVOKE_URL>" "https://api.telegram.org/bot<ACCESS_TOKEN>/setWebhook"

Pull Requests

Pull requests are greatly welcomed. Feel free to add in any stuff that you'd like the bot to do.

Seng Bot is already currently running, if you're on Telegram, please invite @seng_bot into your groups to try out his functions.

I'd like this bot to be a community bot so if you have any cool stuff you'd like to add, just pull request over and I'll deploy bot.

Current Functions

@seng_bot currently only listens for Location messages. To test out his ability, share your location with the bot and he will return information like the following:

Screenshot

Data Sources

Reference Guide

Converting KML into GeoJSON for Mongoimport

Writing a Serverless Python Microservice with AWS Lambda and AWS API Gateway

Siawyoung for letting us use his Profile Pic

Contributors

Shoutouts