0.2.0 • Published 8 years ago

cloud-chat-bridge v0.2.0

Weekly downloads
4
License
MIT
Repository
github
Last release
8 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

8 years ago

0.1.57

8 years ago

0.1.56

8 years ago

0.1.54

8 years ago

0.1.53

8 years ago

0.1.52

8 years ago

0.1.50

8 years ago

0.1.49

8 years ago

0.1.48

8 years ago

0.1.47

8 years ago

0.1.46

8 years ago

0.1.45

8 years ago

0.1.43

8 years ago

0.1.42

8 years ago

0.1.41

8 years ago

0.1.40

8 years ago

0.1.39

8 years ago

0.1.37

8 years ago

0.1.36

8 years ago

0.1.35

8 years ago

0.1.34

8 years ago

0.1.32

8 years ago

0.1.31

8 years ago

0.1.30

8 years ago

0.1.28

8 years ago

0.1.27

8 years ago

0.1.26

8 years ago

0.1.25

8 years ago

0.1.24

8 years ago

0.1.23

8 years ago

0.1.22

8 years ago

0.1.21

8 years ago

0.1.20

8 years ago

0.1.19

8 years ago

0.1.18

8 years ago

0.1.17

8 years ago

0.1.16

8 years ago

0.1.15

8 years ago

0.1.14

8 years ago

0.1.13

8 years ago

0.1.12

8 years ago

0.1.11

8 years ago

0.1.10

8 years ago

0.1.9

8 years ago

0.1.8

8 years ago

0.1.7

8 years ago

0.1.6

8 years ago

0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago