1.0.1 • Published 3 years ago
serverless-plugin-telegram-webhook v1.0.1
serverless-plugin-telegram-webhook
Serverless plugin for automatically setting telegram webhook to lambda api gateway url on deploy.
Install
yarn add -D serverless-plugin-telegram-webhook
# or
npm install --save-dev serverless-plugin-telegram-webhookAdd the following plugin to your serverless.yml:
plugins:
- serverless-plugin-telegram-webhookConfigure
Set the config in the self:custom of your serverless.yml file.
Using reference to lambda
custom:
telegramWebhook:
token: "my-telegram-bot-token"
webhook:
type: function
value: webhookHandler # your lambda function identifierUsing reference to api gateway path
custom:
telegramWebhook:
token: "my-telegram-bot-token"
webhook:
type: path
value: /webhook # your http api pathYour serverless.yml should be similar to this:
Using reference to lambda function
service: serverless-example
plugins:
- serverless-plugin-telegram-webhook
custom:
telegramWebhook:
token: my-telegram-bot-token
webhook:
type: function
value: hello # reference to the hello lambda function
provider:
name: aws # this plugin currently only works with aws
functions:
hello:
handler: handler.hello
events:
- http:
path: hello
method: getUsing api gateway path
service: serverless-example
plugins:
- serverless-plugin-telegram-webhook
custom:
telegramWebhook:
token: my-telegram-bot-token
webhook:
type: path
value: /hello
provider:
name: aws # this plugin currently only works with aws
functions:
hello:
handler: handler.hello
events:
- http:
path: hello
method: getContributing
PRs are greatly appreciated, help us build this hugely needed tool so anyone else can easily build telegram bots using serverless framework.
- Create a fork
- Create your feature branch:
git checkout -b my-feature - Commit your changes:
git commit -am 'add some feature' - Push to the branch:
git push origin my-new-feature - Submit a pull request 🚀