Real-time Cyrillic-to-Latin transliteration bot for Discord and Telegram
- 🔄 Automatic transliteration of Cyrillic characters
- 📊 Cyrillic content detection with percentage analysis
- 🤖 Multi-platform support:
- Discord message responses
- Telegram inline queries
- 🎯 Custom transliteration rules
- ⚡ Discord and Telegram clients run concurrently
- Clone the repository:
git clone https://github.com/yourusername/latinica.git
cd latinica- Create
.envfile:
DISCORD_TOKEN=your_discord_bot_token
TELEGRAM_TOKEN=your_telegram_bot_token- Build and run:
cargo run- Invite your bot to a server
- Send any message containing Cyrillic text
- Bot will respond with transliterated text
- Open any chat
- Type
@your_bot_username your_query - Select transliterated text from inline results
Uses custom mappings designed for phonetic transliteration of Cyrillic characters:
- Supports all Russian Cyrillic letters (
а-я,А-Я) includingёandЁ - Special multi-character mappings (e.g., "ща" → "šia", "ЩА" → "ŠIA")
- Case-sensitive replacements (e.g., "Ж" → "Ž", "ж" → "ž")
- Fallback preserves original characters with no mapping (e.g., punctuation)
- Context-aware handling for letter combinations like "щ" in different positions
See transliterate/mod.rs for full character mapping definitions.
cargo runcargo test
# Includes:
# - Cyrillic detection tests
# - Transliteration accuracy tests
# - Edge case handling- Fork the repository
- Create your feature branch (
git checkout -b feature/fooBar) - Commit your changes (
git commit -am 'Add some fooBar') - Push to the branch (
git push origin feature/fooBar) - Create a new Pull Request