HoranAI is a Node.js-powered Telegram bot designed for grammar correction and translation using the OpenAI API and an external translation service. This bot allows users to send messages for grammar correction and supports inline message editing for easy interaction within chats.
- Grammar Correction: Fix grammatical errors using OpenAI's language model.
- Translation: Translate messages.
- Inline Message Support: Perform corrections and translations directly in any chat using inline mode.
- User Interaction: Greet users on first start with a welcome message.
- Inline Buttons:
Translate
: Translates the corrected message.Grammar Fix
: Fixes grammatical errors again.Delete
: Deletes the bot's message and the user's last message.Settings
: Displays user profile information.Help
: Provides guidance on how to use the bot.
Ensure you have the following installed:
- Node.js v20.18+
- Telegram Bot Token from BotFather
- OpenAI API Key
# Clone the repository
git clone https://github.com/gemechis-elias/HoranAI.git
# Navigate into the project directory
cd HoranAI
# Install dependencies
npm install
Create a .env
file in the root directory with the following keys:
TELEGRAM_BOT_TOKEN=your-telegram-bot-token
OPENAI_API_KEY=your-openai-api-key
OPENAI_MODEL=your-openai-model
TRANSLATE_API_URL=your-translation-api-url
SUPABASE_URL=your-supabase-url
SUPABASE_KEY=your-supabase-key
node bot.js
HoranAI Bot will start polling for messages and respond to commands.
- Start the Bot: Use
/start
to begin interacting with the bot. - Grammar Correction: Send a message, and the bot will return the corrected version with buttons.
- Inline Mode: Mention the bot's username in any chat and provide a message for inline grammar correction.
- Translation: Click
Translate
to get a translated version. - Settings: Click
Settings
to view your profile info. - Help: Click
Help
for usage instructions.
Contributions are welcome! Feel free to open an issue or submit a pull request.
This project is open-source and available under the MIT License.
⭐️ Star this repository to show your support!