0.2.0 • Published 7 years ago

cloud-chat-bridge v0.2.0

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

7 years ago

0.1.57

7 years ago

0.1.56

7 years ago

0.1.54

7 years ago

0.1.53

7 years ago

0.1.52

7 years ago

0.1.50

7 years ago

0.1.49

7 years ago

0.1.48

7 years ago

0.1.47

7 years ago

0.1.46

7 years ago

0.1.45

7 years ago

0.1.43

7 years ago

0.1.42

7 years ago

0.1.41

7 years ago

0.1.40

7 years ago

0.1.39

7 years ago

0.1.37

7 years ago

0.1.36

7 years ago

0.1.35

7 years ago

0.1.34

7 years ago

0.1.32

7 years ago

0.1.31

7 years ago

0.1.30

7 years ago

0.1.28

7 years ago

0.1.27

7 years ago

0.1.26

7 years ago

0.1.25

7 years ago

0.1.24

7 years ago

0.1.23

7 years ago

0.1.22

7 years ago

0.1.21

7 years ago

0.1.20

7 years ago

0.1.19

7 years ago

0.1.18

7 years ago

0.1.17

7 years ago

0.1.16

7 years ago

0.1.15

7 years ago

0.1.14

7 years ago

0.1.13

7 years ago

0.1.12

7 years ago

0.1.11

7 years ago

0.1.10

7 years ago

0.1.9

7 years ago

0.1.8

7 years ago

0.1.7

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago