Giter Club home page Giter Club logo

webex-status-bot's Introduction

Steps to deploy a new bot from sources

Pre-requisites

  1. Clone the repo
  2. Run npm install

Creating a project in Google Apps Script

  1. Run clasp login
  2. Run clasp create --type standalone
  3. Edit the file .clasp.json by adding filePushOrder:
{
  "scriptId": "...",
  "filePushOrder": [
    "Common.ts",
    "RequestManager.ts",
    "Store.ts",
    "BotCache.ts",
    "Constants.ts",
    "Utils.ts"
  ]
}
  1. Run clasp push. Type Yes for Manifest file has been updated. Do you want to push and overwrite?

  2. Run clasp open and open the project link in the browser.

  3. In browser, open Test.gs file and run the test function to initialize a default config.

  4. Now deploy the first version of the script: Publish -> Deploy as webapp... -> Click Update. Copy Web app URL, it's your webAppHook for the MainConfig.

  5. In browser, open File -> Project Properties -> Script Properties and copy the content of property Config. This config has to be updated inline per your needs. For convenience, you can edit it in your favourite JSON editor and then save the new value. Default config example:

    {"botName":"NotSpecified","botEmail":"NotSpecified","admins":["NotSpecified"],"botAuthToken":"NotSpecified","webAppHook":"NotSpecified","dailyReportTo":[],"managers":[],"dailyStatusRoomId":"NotSpecified","operationsRoomId":"NotSpecified","debugRoomId":"NotSpecified","helpPageUrl":"NotSpecified"}

    The initial required params are: botName, botEmail, botAuthToken, webAppHook.

    Suggestions:

  6. Once you have all parameters filled in, open Main.gs file and run the Bot_Init function.

  7. Create a "Debug Room" space in the Webex and invite the bot into the space. Send bot a message by mentioning it, to see the help, example: @mybot help. You need to initialize the debug room first, run, example: @mybot init debug room. This room will be used for Debug messages.

  8. To see the other commands, send, example: @mybot help.

Setting up triggers

To run functions, such as Bot_AskStatuses, Bot_CheckStatuses, on a regular basis, use the Google Apps Script triggers feature: img.png

Some functions require additional permissions. Run a desired function manually to explicitly give it permissions (one time operation).

That's it!

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.