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
- Host: GitHub
- URL: https://github.com/xinthink/webhooks
- Owner: xinthink
- License: mit
- Created: 2019-08-08T02:31:46.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-11T01:14:50.000Z (over 3 years ago)
- Last Synced: 2025-02-13T20:52:07.200Z (over 1 year ago)
- Topics: firebase-cloud-functions, telegram-bot, travis-ci, webhooks
- Language: TypeScript
- Size: 968 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 21
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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/