项目作者: bogdan-kovalev

项目描述 :
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.
高级语言: TypeScript
项目地址: git://github.com/bogdan-kovalev/webex-status-bot.git
创建时间: 2021-06-09T10:20:45Z
项目社区:https://github.com/bogdan-kovalev/webex-status-bot

开源协议:MIT License

下载


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:
    1. {
    2. "scriptId": "...",
    3. "filePushOrder": [
    4. "Common.ts",
    5. "RequestManager.ts",
    6. "Store.ts",
    7. "BotCache.ts",
    8. "Constants.ts",
    9. "Utils.ts"
    10. ]
    11. }
  4. Run clasp push. Type Yes for Manifest file has been updated. Do you want to push and overwrite?
  5. Run clasp open and open the project link in the browser.
  6. In browser, open Test.gs file and run the test function to initialize a default config.
  7. 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.
  8. 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:

    1. {"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:

  9. Once you have all parameters filled in, open Main.gs file and run the Bot_Init function.
  10. 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.
  11. 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!