Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fuadop/serverless-plugin-telegram-webhook
serverless plugin to set your lambda api gateway url as your telegram bot webhook.
https://github.com/fuadop/serverless-plugin-telegram-webhook
Last synced: about 1 month ago
JSON representation
serverless plugin to set your lambda api gateway url as your telegram bot webhook.
- Host: GitHub
- URL: https://github.com/fuadop/serverless-plugin-telegram-webhook
- Owner: fuadop
- License: mit
- Created: 2022-08-08T18:31:13.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-08-13T09:40:44.000Z (over 2 years ago)
- Last Synced: 2024-09-13T17:09:39.946Z (2 months ago)
- Language: TypeScript
- Size: 5.86 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# serverless-plugin-telegram-webhook
Serverless plugin for automatically setting telegram webhook to lambda api gateway url on deploy.
## Install
```bash
yarn add -D serverless-plugin-telegram-webhook
# or
npm install --save-dev serverless-plugin-telegram-webhook
```Add the following plugin to your `serverless.yml`:
```yaml
plugins:
- serverless-plugin-telegram-webhook
```## Configure
Set the config in the `self:custom` of your `serverless.yml` file.
### Using reference to lambda
```yaml
custom:
telegramWebhook:
token: "my-telegram-bot-token"
webhook:
type: function
value: webhookHandler # your lambda function identifier
```### Using reference to api gateway path
```yaml
custom:
telegramWebhook:
token: "my-telegram-bot-token"
webhook:
type: path
value: /webhook # your http api path
```Your `serverless.yml` should be similar to this:
#### Using reference to lambda function
```yaml
service: serverless-exampleplugins:
- serverless-plugin-telegram-webhookcustom:
telegramWebhook:
token: my-telegram-bot-token
webhook:
type: function
value: hello # reference to the hello lambda functionprovider:
name: aws # this plugin currently only works with awsfunctions:
hello:
handler: handler.hello
events:
- http:
path: hello
method: get
```#### Using api gateway path
```yaml
service: serverless-exampleplugins:
- serverless-plugin-telegram-webhookcustom:
telegramWebhook:
token: my-telegram-bot-token
webhook:
type: path
value: /helloprovider:
name: aws # this plugin currently only works with awsfunctions:
hello:
handler: handler.hello
events:
- http:
path: hello
method: get
```## Contributing
PRs are greatly appreciated, help us build this hugely needed tool so anyone else can easily build telegram bots using serverless framework.
1. Create a fork
2. Create your feature branch: `git checkout -b my-feature`
3. Commit your changes: `git commit -am 'add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request 🚀