Your bot is online and LibreTranslate is working. Now let’s combine them so Nuvi’s friends can chat in different languages!
What You’ll Build
Your bot will become a translation helper that:
- Figures out what language people are typing in
- Automatically translates messages for people who need it
- Sends translations privately (so the chat doesn’t get messy)
- Has a backup
/translatecommand just in case
Nuvi says: Don't worry if this seems like a lot! We've broken it into smaller pieces that are easy to follow.Before You Start
Check that you have:
- LibreTranslate running (with English & Spanish)
- Your bot online (the
/hellocommand works) - The
requestspackage installed - Message Content turned on in Discord (so your bot can read messages)
What You’ll Have When Done
Your bot will have these commands:
/register_language- Sign up for translations/my_language- Check your settings/stop_translation- Stop getting translations/translate- Manually translate something
Test Your Bot
After building everything:
- Sign people up: Have friends pick different languages
- Send messages: Watch translations appear in DMs
- Try manual mode: Test
/translatewith any phrase - Opt out: Make sure
/stop_translationworks
Need Help?
| Problem | Where to Look |
|---|---|
| Can’t detect languages | Detect Language Function |
| Translation not working | Translate Text Function |
| Can’t sign up | Registration Commands |
| No auto-translations | Message Handling |
| Want the complete code | Full Bot Code |