https://github.com/bramsuurdje/babelbot
A Discord translation BOT
https://github.com/bramsuurdje/babelbot
Last synced: 3 months ago
JSON representation
A Discord translation BOT
- Host: GitHub
- URL: https://github.com/bramsuurdje/babelbot
- Owner: BramSuurdje
- License: isc
- Created: 2025-03-01T14:25:36.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2025-03-01T14:47:24.000Z (3 months ago)
- Last Synced: 2025-03-01T15:28:00.226Z (3 months ago)
- Language: TypeScript
- Homepage:
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Discord Translation Bot
A Discord bot that automatically detects and translates non-English messages into English. The bot uses Claude AI to detect the language and provide accurate translations, including slang and abbreviations.
## Features
- Automatic language detection
- Real-time translation to English
- Preserves original meaning, including slang and abbreviations
- Clean embed display with original language information
- Ignores bot messages and commands## Requirements
- Node.js or Bun runtime
- Discord bot token
- Anthropic API key## Installation
1. Clone this repository
2. Install dependencies:```bash
npm install
# or
bun install
```3. Create a `.env` file based on the example:
```
DISCORD_TOKEN=your-discord-token
ANTHROPIC_API_KEY=your-anthropic-api-key
```## Usage
Start the bot:
```bash
npm start
# or
bun start
```For development with hot reloading:
```bash
npm run dev
# or
bun run dev
```## Docker Deployment
Build and run with Docker Compose:
Add the api keys to the docker compose at `compose.yml`
```yml
- ANTHROPIC_API_KEY=sk-
- DISCORD_TOKEN=discord-token
``````bash
docker compose up -d
```## How It Works
1. The bot listens to all messages in channels it has access to
2. When a non-English message is detected, it's sent to Claude AI for translation
3. The translation is posted as a reply to the original message in an embed
4. Messages in English or starting with `/` are ignored## Configuration
The bot uses the following environment variables:
- `DISCORD_TOKEN`: Your Discord bot token
- `ANTHROPIC_API_KEY`: Your Anthropic API key for Claude AI## License
ISC
## Author
Bram Suurd