Telex Grammar Fixer is a modifier integration for the Telex platform that automatically corrects grammatical errors in messages before they are sent.
- Automatically fixes grammatical errors in messages.
- Works with Telex webhooks.
- Supports multiple languages.
- Provides real-time corrections before messages are sent.
This integration is hosted on Railway using a Dockerfile.
-
Clone the repository:
git clone <repository-url> cd <repository-directory>
-
Set up a virtual environment:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install dependencies:
pip install -r requirements.txt
-
Run the application:
python app.py
-
Install the Railway CLI:
curl -fsSL https://railway.app/install.sh | sh -
Login to Railway:
railway login
-
Create a new project and deploy:
railway init railway up
- POST
/: Receives messages, corrects grammar, and returns the corrected message. - GET
/json: Returns integration metadata.
Ensure the following environment variables are set:
SAPLING_API_KEY- API key for the grammar correction service.
To test locally, you can send a request using cURL:
curl -X POST http://localhost:5000/ -H "Content-Type: application/json" -d '{"message": "This are a bad sentence"}'Expected Response:
{
"event_name": "grammar_correction",
"message": "This is a bad sentence",
"status": "success",
"username": "Unknown"
}The application includes unit tests to verify functionality. To run them:
-
Ensure the virtual environment is activated
source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Run the tests using unittest
python -m unittest tests.py
-
Expected output (if all tests pass):
... ---------------------------------------------------------------------- Ran 3 tests in X.XXXs OK -
If a test fails, check the output for errors and adjust accordingly.
Follow these steps to properly integrate and test your application within the Telex organization:
- Navigate to the Telex dashboard.
- Add your integration (app), e.g.,
FastAPI APM.
- Create a new channel for testing your app, e.g.,
#fastapi-apm.
- Go to the Apps tab and locate your app.
- Click Manage Access next to your app.
- Click Output and set the Custom Channel to only your dedicated testing channel.
- Ensure that only your channel is checked in the list of available channels.
By following these steps, you prevent your app from interfering with other integrations in the organization, ensuring a smooth and isolated testing environment.
Below are screenshots demonstrating how the integration works in a Telex channel:
The message before being processed by the integration:

The message after being corrected by the integration:

Pull requests are welcome. Please follow best coding practices and ensure proper documentation.
This project is licensed under the MIT License.