Skip to content

A bot for the Cisco Webex application, the primary purpose of which is collecting daily statuses from different team members. Written on Google Apps Script.

License

Notifications You must be signed in to change notification settings

bogdantimes/webex-status-bot

Repository files navigation

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!

About

A bot for the Cisco Webex application, the primary purpose of which is collecting daily statuses from different team members. Written on Google Apps Script.

Topics

Resources

License

Stars

Watchers

Forks