0.2.0 • Published 6 years ago

cloud-chat-bridge v0.2.0

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

cloud-chat-bridge

Framework for Google Cloud Functions to bridge communications in chat services to others, such as

  • LINE -> Slack
  • Slack -> LINE <- coming soon

Example of your index.js

const bridge = require("cloud-chat-bridge");

// Your secret variables, see following for details
const vars = require("./secret.json");
const app = bridge.init({vars});

// Your rules to bridge messages, see following for details
const rules = require("./rules");
const endpoint = app.webhook(rules);

exports.webhook = endpoint;

Example rules

module.exports = [
  {
    // From any groups of LINE
    "source": {
      "group": /.*/
    },
    // To "random" channel of Slack
    "destination": {
      "service": "Slack",
      "channels": ["random"]
    }
  }
]

Variables you might need

secret.json, like this

{
  "LINE_CHANNEL_SECRET": "XXXXXX",
  "LINE_CHANNEL_ACCESS_TOKEN": "XXX",
  "SLACK_INCOMING_WEBHOOK_URL": "https://hooks.slack.com/services/XXX/ZZZ"
}
  • LINE_CHANNEL_SECRET
    • can be get when you create provider and bot channel in LINE developer console.
  • LINE_CHANNEL_ACCESS_TOKEN
    • can be created when you create provider and bot channel in LINE developer console.
  • SLACK_INCOMING_WEBHOOK_URL
    • can be created when you enable incoming-webhook in Slack console.

How to deploy your index.js to Google Cloud Functions

gcloud functions deploy webhook_line --trigger-http

See links below for more information

0.2.0

6 years ago

0.1.57

6 years ago

0.1.56

6 years ago

0.1.54

6 years ago

0.1.53

6 years ago

0.1.52

6 years ago

0.1.50

6 years ago

0.1.49

6 years ago

0.1.48

6 years ago

0.1.47

6 years ago

0.1.46

6 years ago

0.1.45

6 years ago

0.1.43

6 years ago

0.1.42

6 years ago

0.1.41

6 years ago

0.1.40

6 years ago

0.1.39

6 years ago

0.1.37

6 years ago

0.1.36

6 years ago

0.1.35

6 years ago

0.1.34

6 years ago

0.1.32

6 years ago

0.1.31

6 years ago

0.1.30

6 years ago

0.1.28

6 years ago

0.1.27

6 years ago

0.1.26

6 years ago

0.1.25

6 years ago

0.1.24

6 years ago

0.1.23

6 years ago

0.1.22

6 years ago

0.1.21

6 years ago

0.1.20

6 years ago

0.1.19

6 years ago

0.1.18

6 years ago

0.1.17

6 years ago

0.1.16

6 years ago

0.1.15

6 years ago

0.1.14

6 years ago

0.1.13

6 years ago

0.1.12

6 years ago

0.1.11

6 years ago

0.1.10

6 years ago

0.1.9

6 years ago

0.1.8

6 years ago

0.1.7

6 years ago

0.1.6

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago