The example demonstrates a Telegram bot that uses the Amazon Lex & Amazon Rekognition service, and the deployment needed for Telegram bots in general.
This example uses the following Amazon Services
- Amazon Simple Storage Service (S3) - Store receipts and configuration files
- Amazon DynamoDB- Store attributes from a receipt
- Amazon API Gateway - API connectivity with Telegram.org
- Amazon Simple Notification Service (SNS) - Coordinating the delivery of messages to subscribing endpoints between the different micro services
- Amazon Lex - Amazon Lex for building conversational interfaces with the user application using text.
- Amazon Rekognition - Text recognition service for receipt attributes
- AWS Lambda - Run code without provisioning or managing servers
I have written the installation steps for OS X & Linux:
npm install -g serverless
install the AWS Command Line Interface
git clone git:https://github.com/onnobos/expensy_bot.git
cd github-link
npm install
serverless deploy
Upload config.json and template.html to config S3 bucket
- Register telegram bot with Telegram.org
- Set the webhook, based URL endpoint mentioned in "Step 1. Clone GitHub repository"
- Create an empty file called serverless.env.yml with the content below.
dev:
TELEGRAM_API: '<TELEGRAM API>'
For building out your Lex chatbot, follow the instructions for building a lex bot.
- Add your bot in Telegram client
- Enter
Welcome
orHelp
- Enter
I want to do a expense claim
- 0.0.1
- Work in progress
Onno Bos – twitter @obeone
Distributed under the GNU GPLv3 license. See GNU GPLv3
for more information.