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.
- Make sure you have already created a Telegram Bot
- 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
- Add your telegram bot API key into a .env file.
Your .env file should look like:
# .env
TELEGRAM_API_KEY=<APIKEY>
- Zip up the files
$ zip -r py.zip *
$ zip -j py.zip .env
-
Upload the zip file into AWS Lambda
-
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 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.
@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:
- Data.gov.sg Dengue Cluster KML
- Openweathermap.org API
- David Chua's Dengue API (will write a post about it soon!)
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
- Singapore Python User Group
- Siawyoung