Skip to content
This example demonstrates how to setup an echo Telegram Bot using the Serverless Framework βš‘πŸ€–
Python
Branch: master
Clone or download

Latest commit

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
LICENSE
README.md
handler.py
package-lock.json
package.json
requirements.txt
serverless.yml

README.md

Serverless Telegram Bot

This example demonstrates how to setup an echo Telegram Bot using the Serverless Framework βš‘πŸ€–

Usage

What do I need?

  • A AWS key configured locally, see here.
  • Python 3.7.
  • NodeJS. I tested with v8.9.0.
  • A Telegram account.

Installing

# Install the Serverless Framework
$ npm install serverless -g

# Install the necessary plugins
$ npm install

# Create and active a Python 3.7 venv
$ python3.7 -m venv venv && souce venv/bin/activate

# Get a bot from Telegram, sending this message to @BotFather
$ /newbot

# Put the token received into a file called serverless.env.yml, like this
$ cat serverless.env.yml
TELEGRAM_TOKEN: <your_token>

# Deploy it!
$ serverless deploy

# With the URL returned in the output, configure the Webhook
$ curl -X POST https://<your_url>.amazonaws.com/dev/set_webhook

Now, just start a conversation with the bot :)

You can’t perform that action at this time.