Giter Site home page Giter Site logo

hubot-ringcentral's Introduction

hubot-ringcentral (legacy: hubot-glip)

Hubot adapter to use with RingCentral Team Messaging.

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 [email protected] hubot-ringcentral && 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.

Create 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 RingCentral Team Messaging, 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 ringcentral -n x
  • RINGCENTRAL_SERVER - This is the RingCentral 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.ringcentral.com, for sandbox login https://app.devtest.ringcentral.com/

Find your bot in RingCentral 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.

hubot-ringcentral's People

Contributors

byrnereese avatar nejoyer avatar tylerlong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

hubot-ringcentral's Issues

Support Glip adapter for Hubot Conversations

The Glip adapter currently supports basic hubot commands like hear, send , reaply ...etc. but does not support a conversation. Can the adapter be enhances to support conversations using hubot conversations.

A sample example can be found in https://github.com/pkvenu/zendesk

Running the example:
zendesk > bin/hubot
zendesk zendesk list tickets

once this command finishes it will ask if you need more information ? yes or no?

yes
enter ticket number ? 5419
It will output more details about the ticket.

Details on how to integrate glip adapter

Followed instructions in Readme.md and created my hubot; runs well locally.

How do I integrate the src files (and all other files in your repo) into my hubot project? I entered 'glip' (no quotes) when prompted for the adapter as instructed.

Thanks!

Error when initiating bot

Have used instructions in README, but continue getting this error. Using a private bot on a test account.

[Tue Mar 10 2020 19:39:40 GMT-0400 (Eastern Daylight Time)] INFO Token restored from file
[Tue Mar 10 2020 19:39:40 GMT-0400 (Eastern Daylight Time)] ERROR Cannot load adapter glip - TypeError: _this.subscribe is not a function```

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.