-
Notifications
You must be signed in to change notification settings - Fork 433
Smart bms gas discord #70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
nssuwan186-dev
wants to merge
7
commits into
google-labs-code:main
Choose a base branch
from
nssuwan186-dev:smart-bms-gas-discord
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Smart bms gas discord #70
nssuwan186-dev
wants to merge
7
commits into
google-labs-code:main
from
nssuwan186-dev:smart-bms-gas-discord
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This commit introduces a complete Smart Business Management System (BMS) built on Google App Script and integrated with a Discord bot. The system includes the following features: - Dynamic Reporting: Generate summaries and detailed views of tasks. - CRM/Personnel Management: Full CRUD operations for managing personnel, customers, and tenants. - Financial Calculations: Automated calculation for rent and payroll. - Document Generation: Automated creation of invoices as Google Docs from templates. The codebase is modular, with separate `.gs` files for each core feature, a central interface for Google Sheet interactions, and a main handler for Discord webhooks. A detailed `README.md` is included with full setup instructions.
Adds full support for a Telegram bot alongside the existing Discord bot. - Updates `Main.gs` to differentiate between incoming webhooks from Discord and Telegram, routing them to the appropriate handlers. - Adds `Telegram_Handler.gs` to parse commands (`/report`, `/detail`, etc.) from Telegram messages. - Adds `Telegram_Interface.gs` to send formatted responses back to the Telegram API. - Updates `README.md` with a new, optional section detailing how to create a Telegram bot with BotFather and set up the webhook. - The `Config` sheet instructions in the `README.md` are updated to include the new `TELEGRAM_BOT_TOKEN`.
Removes the Discord bot integration to streamline the project for Telegram-only use, as requested. - Deletes `Discord_Handler.gs`. - Simplifies the `doPost` function in `Main.gs` to only process Telegram webhooks. - Updates `README.md` to remove all sections related to Discord bot creation, token configuration, and webhook setup. - Renumbers and cleans up the `README.md` to provide a clear setup guide for the Telegram-only version.
Refactors the core logic to process natural language instead of relying on rigid `/command` structures.
- Introduces a new `AI_Processor.gs` module. This module contains a (currently mocked) function to interpret raw user text and convert it into a structured command object (e.g., `{command: "report", parameters: {}}`).
- Updates `Telegram_Handler.gs` to send all user text to `AI_Processor.gs` first. The handler now executes commands based on the structured data returned by the AI processor.
- Updates the `README.md` to include instructions for adding a future `AI_SERVICE_API_KEY` to the `Config` sheet.
- The core modules (`Reporting_Module`, `CRM_Module`, etc.) remain unchanged as their flexible design was already compatible with this new approach.
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
This commit introduces a full-featured, open-source Python version of the Smart BMS Bot, migrating from the previous Google App Script implementation. This new version is architected for scalability and advanced functionality, featuring: - **Core Technology:** Python 3 with asynchronous handling via `python-telegram-bot`. - **Natural Language Processing (NLP):** Integrates `spaCy` with the Thai language model (`th_core_web_sm`) to understand natural user commands instead of rigid slash commands. - **Optical Character Recognition (OCR):** Utilizes `Pytesseract` and `Pillow` to extract text from images sent by the user. - **Google Sheets Integration:** Manages database operations using `gspread` and Google Service Account authentication for robust and secure access. - **Modular Structure:** The project is broken down into logical modules (`bot_logic`, `nlp_processor`, `ocr_processor`, `sheets_handler`) for maintainability. - **Configuration Management:** A `config.py` file is used to manage all secrets and settings. - **Dependency Management:** All required libraries are listed in `requirements.txt`. - **Comprehensive Documentation:** A new `README.md` provides detailed setup and usage instructions for the Python environment.
This commit introduces a major architectural update to support Telegram Mini Apps, transforming the project into a full-stack application with a clear separation between the backend and frontend. Key changes include: - **Project Restructure:** The codebase is now split into a `backend` directory for all Python server-side logic and a `frontend` directory for the HTML, CSS, and JS files of the Mini App. - **Flask API Server:** The `main.py` has been upgraded to run a Flask web server. The Telegram bot polling now runs in a dedicated background thread. The Flask server serves the static frontend files. - **API Endpoints:** Added `/api/get_tasks` and `/api/get_personnel` endpoints to the Flask app, allowing the Mini App to fetch live data from the Google Sheet database. - **Mini App Frontend:** Created a functional dashboard UI (`index.html`, `style.css`, `script.js`) that initializes the Telegram Web App SDK, displays user info, and now fetches and renders data from the backend APIs. - **New Bot Command:** A `/dashboard` command has been added. When used, the bot replies with a `ReplyKeyboardMarkup` button that directly opens the Mini App inside the user's Telegram client. - **Documentation & Quality:** The `README.md` has been extensively updated to reflect the new project structure and provides detailed instructions for running the Flask server and using `ngrok` for local development. A `.gitignore` has also been added.
…t the full booking conversation handler. This commit finalizes the migration of the Hotel OS Bot from a Google Colab notebook to a structured and professional Python application. Key changes include: - **Architectural Refactor:** The entire codebase is now modular, with logic separated into handlers, database, processors, and sheets modules. - **Complete Booking Flow:** The previously incomplete multi-step conversation handler for booking reservations (`reserve`) has been fully implemented, allowing users to create new bookings from start to finish. - **Bug Fixes & Robustness:** Corrected several issues, including undefined state variables and missing imports, and improved the overall flow of conversations. - **Documentation:** The `README.md` provides a comprehensive guide to setting up and running the project. The application is now a complete and functional version of the system designed in the notebook, ready for deployment.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Please provide a brief description of your addition or change.
Checklist