2.4.2 • Published 6 years ago

hubot-glip v2.4.2

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

hubot-glip

Hubot adapter to use with Glip.

Video tutorials

Create a new bot

Create new project with the following structure:

your-bot/
    scripts/
    external-scripts.json

In the root of your bot project, execute:

yarn add hubot@2.19.0 hubot-glip && yarn add --dev babel-polyfill

Add external scripts

Take hubot-help for example:

yarn add hubot-help

Then config it to external-scripts.json:

[
    "hubot-help"
]

Add custom scripts

Let's assume that we want to add ping feature to the bot.

Creat scripts/ping.js file with the following content:

// Commands:
//   hubot ping - ping the bot
module.exports = robot => {
  robot.respond(/ping$/, res => {
    res.send('pong')
  })
}

Get RingCentral access_token

This step is different for provate bot and public bot.

Private bot

If you bot is a private bot, you can simply use the default OAuth Redirect URI: https://www.ringcentral.com. And you can get the token from GUI of https://developer.ringcentral.com. Create token.json in the root of your bot project with the following content:

{
    "access_token": "the-access-token-string"
}

Public bot

If you bot is a public bot, You need to set the OAuth Redirect URI to ${RINGCENTRAL_BOT_SERVER}/oauth.

For example, if your bot is running on local with ngrok uri https://xxxxx.ngrok.io, you should set the OAuth Redirect URI to https://xxxxx.ngrok.io/oauth.

When you successfully add the bot to Glip, a token.json file will be created for you automatically.

Run your bot

RINGCENTRAL_SERVER=https://platform.devtest.ringcentral.com \
RINGCENTRAL_CLIENT_ID=clientId \
RINGCENTRAL_CLIENT_SECRET=clientSecret \
RINGCENTRAL_BOT_SERVER=https://the-bot-server \
npx hubot -a glip -n x
  • RINGCENTRAL_SERVER - This is the Glip API server. Optional. By default it's https://platform.ringcentral.com. Use https://platform.devtest.ringcentral.com for sandbox
  • RINGCENTRAL_BOT_SERVER - Optional. The server that your bot is running on. If you use ngork for development, the uri should be https://xxxxx.ngrok.io. It is only required for public bot and when you do not have a RingCentral access token. Ignore this environment variable if your bot is a private bot or if you already have a RingCentral access token.
  • -n x means the name of your bot is x. You can use any name

Test your bot

For production login https://app.glip.com, for sandbox login https://glip-app.devtest.ringcentral.com/

Find your bot in Glip and talk to it:

Send: x ping
Receive: pong
Send: x help
Receive: xping - ping the bot

Example above assume that your bot's name is x and you have installed exernal script hubot-help and added custom script ping. For more details about them please read content above.

2.4.2

6 years ago

2.4.1

6 years ago

2.4.0

6 years ago

2.3.8

6 years ago

2.3.7

6 years ago

2.3.6

6 years ago

2.3.5

6 years ago

2.3.4

6 years ago

2.3.3

6 years ago

2.3.2

6 years ago

2.3.1

6 years ago

2.3.0

6 years ago

2.2.12

6 years ago

2.2.11

6 years ago

2.2.10

6 years ago

2.2.9

6 years ago

2.2.8

6 years ago

2.2.7

6 years ago

2.2.6

6 years ago

2.2.5

6 years ago

2.2.4

6 years ago

2.2.3

6 years ago

2.2.2

6 years ago

2.2.1

6 years ago

2.2.0

6 years ago

2.1.4

7 years ago

2.1.3

7 years ago

2.1.2

7 years ago

2.1.1

7 years ago

2.1.0

7 years ago

2.0.9

7 years ago

2.0.8

7 years ago

2.0.7

7 years ago

2.0.6

7 years ago

2.0.5

7 years ago

2.0.4

7 years ago

2.0.2

7 years ago

0.9.0

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

2.0.0-alpha.6

7 years ago

0.8.6

7 years ago

2.0.0-alpha.5

7 years ago

2.0.0-alpha.4

7 years ago

2.0.0-alpha.3

7 years ago

2.0.0-alpha.2

7 years ago

2.0.0-alpha.1

7 years ago

0.8.5

7 years ago

0.8.4

7 years ago

0.8.3

7 years ago

0.8.2

7 years ago

0.8.1

7 years ago

0.8.0

7 years ago

0.7.9

7 years ago

0.7.8

7 years ago

0.7.7

7 years ago

0.7.6

7 years ago

0.7.5

7 years ago

0.7.3

7 years ago

0.7.2

7 years ago

0.7.1

7 years ago

0.7.0

7 years ago

0.6.0

8 years ago

0.5.0

8 years ago

0.4.0

8 years ago

0.3.0

8 years ago

0.2.0

8 years ago

0.1.0

8 years ago