An open API service indexing awesome lists of open source software.

https://github.com/xinthink/webhooks

Firebase cloud functions as Webhooks
https://github.com/xinthink/webhooks

firebase-cloud-functions telegram-bot travis-ci webhooks

Last synced: 4 months ago
JSON representation

Firebase cloud functions as Webhooks

Awesome Lists containing this project

README

          

# [Firebase cloud functions] as Webhooks

[![Build Status][ci-badge]][ci]
[![MIT][license-badge]][license]

## Broadcast [Travis CI] results to a [Telegram] Channel

First, get your own [Telegram Bot] token.

Create file *functions/src/local.ts*, with content:
```js
export const BOT = {
token: '',
apiPrefix: 'https://api.telegram.org/bot',
chatId: '',
};
```

The `chatId` can be a Telegram Channel or a Group, you can find it easily through [Telegram Web].

- **Channel**: find this in the browser address bar: `im?p=c_xxx`, `chatId` for this channel will be `-100`
- Likewise, for **Group** `im?p=g`, the `chatId` will be `-`

Finally, don't forget to add your bot to the Channel or Group!

## Deployment

- Run `firebase init`
- or create *.firebaserc* manually
```json
{
"projects": {
"default": ""
}
}
```
- run `(cd functions && yarn deploy)`

[Firebase Cloud Functions]: https://firebase.google.com/docs/functions
[Telegram]: https://telegram.org/
[Telegram Bot]: https://core.telegram.org/bots
[Telegram Web]: https://web.telegram.org
[license-badge]: https://img.shields.io/dub/l/vibe-d.svg
[license]: https://raw.githubusercontent.com/xinthink/webhooks/master/LICENSE
[ci-badge]: https://travis-ci.org/xinthink/webhooks.svg?branch=master
[ci]: https://travis-ci.org/xinthink/webhooks
[Travis CI]: https://travis-ci.org/