Skip to content

xinthink/webhooks

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Firebase cloud functions as Webhooks

Build Status MIT

Broadcast Travis CI results to a Telegram Channel

First, get your own Telegram Bot token.

Create file functions/src/local.ts, with content:

export const BOT = {
  token: '<telegram-bot-token>',
  apiPrefix: 'https://api.telegram.org/bot<telegram-bot-token>',
  chatId: '<telegram-chat-id>',
};

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<channel-id>_xxx, chatId for this channel will be -100<channel-id>
  • Likewise, for Group im?p=g<group-id>, the chatId will be -<group-id>

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

Deployment

  • Run firebase init
  • or create .firebaserc manually
    {
      "projects": {
        "default": "<firebase-project-id>"
      }
    }
  • run (cd functions && yarn deploy)

Releases

No releases published

Packages

No packages published