{"id":22829119,"url":"https://github.com/eric-philippe/jaguar-webex-bot","last_synced_at":"2026-05-18T03:06:45.199Z","repository":{"id":237234692,"uuid":"794091527","full_name":"Eric-Philippe/Jaguar-Webex-Bot","owner":"Eric-Philippe","description":"A Webex ChatBot that I made for my coworkers","archived":false,"fork":false,"pushed_at":"2024-07-17T22:10:24.000Z","size":2183,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-06T06:41:15.083Z","etag":null,"topics":["bot","nodejs","sqlite3","webex"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Eric-Philippe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-30T12:46:19.000Z","updated_at":"2024-07-17T22:10:27.000Z","dependencies_parsed_at":"2024-07-18T02:05:48.019Z","dependency_job_id":"89307d1b-0313-40f5-b918-2a1910a7e265","html_url":"https://github.com/Eric-Philippe/Jaguar-Webex-Bot","commit_stats":null,"previous_names":["eric-philippe/jaguar-webex-bot"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Eric-Philippe%2FJaguar-Webex-Bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Eric-Philippe%2FJaguar-Webex-Bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Eric-Philippe%2FJaguar-Webex-Bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Eric-Philippe%2FJaguar-Webex-Bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Eric-Philippe","download_url":"https://codeload.github.com/Eric-Philippe/Jaguar-Webex-Bot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246400284,"owners_count":20770986,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bot","nodejs","sqlite3","webex"],"created_at":"2024-12-12T19:13:24.250Z","updated_at":"2025-10-08T15:01:49.159Z","avatar_url":"https://github.com/Eric-Philippe.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🐆 Jaguar - Webex Bot\n\nThis is a [Webex](https://developer.webex.com) [Node.JS](https://nodejs.org) bot application that serves my work team as a way to manage the common mailbox turn mainly. It features the [webex-node-bot-framework](https://github.com/webex/webex-bot-node-framework) that simplifies development for Webex bots by abstracting away some of the complexity of the API calls and registering for events. The naked project is from the [Webex Starter Bot](https://github.com/WebexSamples/webex-bot-starter) template created by \"jpjpjp\".\n\n## ⚙️ Table of Contents\n\n- [🐆 Jaguar - Webex Bot](#-jaguar---webex-bot)\n  - [⚙️ Table of Contents](#️-table-of-contents)\n  - [📚 Features](#-features)\n  - [📱 Technologies](#-technologies)\n  - [🔗 Architecture](#-architecture)\n    - [🤝 Handlers](#-handlers)\n      - [Events Listener Handler](#events-listener-handler)\n      - [Command Handler and Command Groups](#command-handler-and-command-groups)\n      - [CronScript Handler](#cronscript-handler)\n    - [API Integration](#api-integration)\n      - [EmbedBuilder](#embedbuilder)\n      - [ActionListener](#actionlistener)\n    - [💾 Database](#-database)\n      - [User schema](#user-schema)\n    - [📜 Logger](#-logger)\n    - [✉️ Messages](#️-messages)\n  - [🖥️ Installation](#️-installation)\n    - [🔌 Prerequisites](#-prerequisites)\n    - [🐋 Docker](#-docker)\n    - [💡 Steps to get the bot working](#-steps-to-get-the-bot-working)\n\n## 📚 Features\n\nThe whole list of features can be found in the [TODO.md](TODO.md) file.\nBelow is a list of the main features:\n\n- **Common Box Features**\n  - Add a user to the box\n  - Remove a user from the box\n  - Show the current user in the box\n  - Show all the users in the box\n  - Set the next user in the box\n  - Set the previous user in the box\n  - Assign a specific user to the box\n  - Show the user in the box today\n  - Change the time of the announcement of the box\n  - Change the direction of the distribution of the box\n  - Announce the next user in the box every working day at a specific time (excluding bank holidays)\n\n## Quick run\n\nThe whole app is dockerized, so you can easily run the bot with the following command:\n\n```bash\ndocker compose up --build\n```\n\n## 📱 Technologies\n\n| Tech       | Version |\n| ---------- | ------- |\n| Node       | 21.7.1  |\n| Webex      | 2.3.14  |\n| PostgreSQL | 8.11.3  |\n\n## 🔗 Architecture\n\nThe bot was built with the goal of being as customizable as possible.\n\n### 🤝 Handlers\n\n- **Handlers** - Events listener handler - Command handler - CronScript handler\n\nThis means that you can easily add new commands, events, scripts, command groups without having to change the core of the bot. It makes maintaining the bot easier and faster.\n\n#### Events Listener Handler\n\nThe events listener handler is responsible for listening to the events that the bot receives from the Webex API. It is the first step in the bot's architecture and is responsible for receiving the events and passing them to the command handler. You can decide on the `events/Events.js` file which events you want to listen to.\n\n#### Command Handler and Command Groups\n\nThe command handler is responsible for handling the commands that the bot receives from the Webex API. It is the second step in the bot's architecture and is responsible for receiving the commands and passing them to the correct command group. You can decide on the `commands/Commands.js` file which commands you want to add to the bot. For example, in my development, I have a command named `Test` that I can easily add and remove from the bot's commands.\n\n#### CronScript Handler\n\nThe cron script handler is responsible for handling the scripts that the bot has to run at a specific time. Even more it is responsible for handling the changes that may occur to the scripts considering that the user can customize the scripts while the bot is running. As for the commands, you can decide on the `scripts/Scripts.js` file which scripts you want to add to the bot.\n\n### API Integration\n\nI allowed myself to write helper classes to make the integration with the Webex API easier. The classes are:\n\n#### EmbedBuilder\n\nBased on my knowledge of the Discord EmbedBuilder implementation, I created a class that allows me to create cards for the Webex API more easily. The class is in the `utils/EmbedBuilder.js` file.\n\n#### ActionListener\n\nI created a Message Action listener that allows to listen to the actions from a single message, allowing to setup a custom maximum time to listen to the actions, a custom timeout message, callback...\n\n### 💾 Database\n\nThe bot uses PostgreSQL database to store the data. The database connection is configured in `.env` file for `Database.js` and serves the table `users` through the `services/UserServices.js` class.\n\n**Database Configuration:**\n\n- Database: jaguar\n\n#### User schema\n\nThe user schema is as follows:\n\n```sql\nCREATE TABLE IF NOT EXISTS users (\n    id VARCHAR(255) PRIMARY KEY NOT NULL,\n    firstName VARCHAR(60) NOT NULL,\n    lastName VARCHAR(60) NOT NULL,\n    pointed BOOLEAN NOT NULL DEFAULT FALSE,\n    is_absent BOOLEAN NOT NULL DEFAULT FALSE\n);\n```\n\n### 📜 Logger\n\nThe logger is a simple logger that logs the miscellaneous information in `Logs/Logs.log` and the caught errors in `Logs/Errors.log`. The logger is in the `utils/Logger.js` file.\n\n### ✉️ Messages\n\nI implemented a simple Message sender to centralize the sending of messages between the error ones, the informations ones and the success ones. It also allows to catch any error that may occur while sending a message. The message sender is in the `utils/MessageSender.js` file.\n\n## 🖥️ Installation\n\n### 🔌 Prerequisites\n\n- [ ] node.js (minimum supported v8.0.0 \u0026 npm 2.14.12 and up)\n\n- [ ] [Sign up for Webex Developer Account](https://developer.webex.com/signup)\n\n### 🐋 Docker\n\nThe whole project is dockerized, so you can easily run the bot with the following command:\n\n```bash\ndocker-compose up\n```\n\n### 💡 Steps to get the bot working\n\n1. Create a Webex bot (save the API access token and username): \u003chttps://developer.webex.com/my-apps/new/bot\u003e\n\n2. Sign up for nGrok, then connect and start it on your machine (save the port number and public web address): \u003chttps://ngrok.com/download\u003e\n\n3. After installing ngrok, run it on your local machine to get a public ip address, eg `ngrok http 3000 --region=eu` or `ngrok http --domain=\u003cyour_domain\u003e 3000`\n\n4. Copy the ip address displayed in the ngrok window, ie: : \u003chttps://1234.eu.ngrok.io\u003e\n\n5. Copy the `.env.local` file to a file called `.env`\n\n6. Edit `.env` with the following values:\n\n   - BOTTOKEN - Set this to the token for your bot that you got in step 1\n   - PORT - Set this to the port you set when you started ngrok in step 3 (ie: 3000)\n   - WEBHOOKURL - Set this to the ip address that you copied in step 4\n   - MAIN_GROUPID - Set this to the group id of the space where you want the bot to work\n\n7. Turn on your bot server with `npm start`\n\n8. Create a space in Webex\n\n9. Add the bot (by its email) to the space in Webex\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feric-philippe%2Fjaguar-webex-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feric-philippe%2Fjaguar-webex-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feric-philippe%2Fjaguar-webex-bot/lists"}