Back to Projects

Translator Bot

AI-Powered Discord Bot, 2025. Offline translation bot for Discord supporting 7 languages with message translation, auto-detection, and channel-specific translation capabilities.

Technologies Used

PythonDiscord APIHugging FacePyTorchlangdetect

Overview

TranslatorBot is a sophisticated Discord bot that brings real-time translation capabilities to Discord servers. The bot leverages Hugging Face's state-of-the-art translation models to provide offline, privacy-preserving translation services without relying on external APIs, enabling seamless multilingual communication across Discord communities.

Key Features

  • Multi-language translation supporting 7 languages (English, Spanish, French, German, Italian, Portuguese, Arabic)
  • Automatic language detection using langdetect library
  • Slash commands for intuitive user interaction
  • Channel-specific auto-translation configuration
  • User preference settings with persistent JSON storage
  • Offline translation with locally cached models
  • Permission management for administrative features
  • Comprehensive error handling with user-friendly messages

Technical Implementation

  • Framework: discord.py 2.3.2 with modern slash command support
  • NLP Models: Helsinki-NLP OPUS-MT models from Hugging Face
  • Deep Learning: PyTorch 2.1.0 for model inference
  • Language Detection: langdetect for automatic language identification
  • Data Storage: JSON-based user and channel settings
  • Deployment: Windows batch scripts and Linux systemd service support
  • Configuration: python-dotenv for secure token management

Supported Languages

  • English (en)
  • Spanish (es)
  • French (fr)
  • German (de)
  • Italian (it)
  • Portuguese (pt)
  • Arabic (ar)

Conclusion

TranslatorBot successfully demonstrates the ability to integrate advanced machine learning models with Discord APIs to create practical, privacy-focused tools. The offline translation capability ensures user data privacy while providing seamless multilingual communication for Discord communities.