Skip to main content

Gchat SDK for managing and closing conversations

Project description

GCHAT Close Conversations

This project automates sending alerts and closing inactive conversations on the GCHAT platform, using API integration.

Features

  • Automatically sends alert messages to inactive contacts.
  • Automatically closes conversations based on configurable criteria.
  • Flexible configuration via environment variables.

Project Structure

.
├── gchat_sdk/
│   ├── controllers/
│   ├── entities/
│   ├── factories/
│   ├── providers/
│   ├── tests/
│   ├── main.py
│   ├── settings.py
│   └── utils.py
├── examples/
│   └── finish_chats.py
├── .env
├── requirements.txt
└── LICENSE

Installation

  1. Clone the repository:

    git clone https://github.com/Gnew-Solucoes-IP-Ltda/gchat-sdk.git
    cd GCHAT-Encerrar-conversas
    
  2. Create and activate a virtual environment:

    python3 -m venv venv
    source venv/bin/activate
    
  3. Install dependencies:

    pip install -r requirements.txt
    
  4. Configure environment variables in the .env file:

    URL_API=https://api.gchat.app.br
    TOKEN_API=your_token
    END_CHATS_WITH_ATTENDANTS_LAST_MESSAGE=True
    END_CHATS_WITH_CONTACTS_LAST_MESSAGE=True
    TIMEOUT=1
    ALERT_TIME=0.1
    

Usage

Run the example to send alerts and close inactive conversations:

python examples/finish_chats.py

Testing

Unit tests are located in gchat_sdk/tests/. To run the tests using unittest:

python -m unittest discover gchat_sdk/tests/

License

This project is licensed under the MIT License. See the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gchat_sdk-0.0.2-py3-none-any.whl (17.2 kB view details)

Uploaded Python 3

File details

Details for the file gchat_sdk-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: gchat_sdk-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 17.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for gchat_sdk-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 bec46f0ea3a7bd055224dedc51b8510bd9a3ae2b315096e5b00b0d8cc63ca6f8
MD5 54ddb85dc1a772dbfd9b701bc0da421d
BLAKE2b-256 de291ffa4704e2689fd1b77139fbca6c5db5b9b61af38718d04f7ba9abc672d0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page