Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Discord Language Bot

What It Is

This is a Discord bot designed to help users translate messages in a server so that communities can accommodate users from different countries and languages.
The bot utilizes deep-translator to provide API-less translations while remaining accurate.

It can:

  • Translate messages between languages
  • Be plugged into existing bots
  • Provide easy setup for beginners

How to Use It As Is

  1. Create your own Discord bot through the Discord Developer Portal.
  2. Get your Discord API key.
  3. Create a .env file and put on the first line: (DISCORD_TOKEN = [Your Discord API key])
  4. Install requirements: (pip3 install -r requirements.txt) to install the requiremnets
  5. Run the bot: (python3 -u Translation_Bot.py)

How it Works

The bot works by watching for flag emojis to be placed under comments. The bot will create a thread under the comment that provides a transalation for the text. Currently the bot supports the following languages:

  • English
  • Spanish
  • Japanese
  • Chinese Mandarin
  • French
  • Tagalog
  • Hindi
  • Thai
  • Arabic
  • Bengali
  • Portugese
  • Russian
  • Indonesian

To show all available languages, use the command "!languages" within discord and it will also give you the appropriate flags.

How to Expand It for Your Use

To expand it to your needs, modify the JSON file with the flag unicode of the nation, the ISO 639-1 language code, and the name of the language itself.

For Example:

({ "flag": "🇬🇧", "code": "en", "name": "English" })


How to Put It Into Your Bot

  1. Copy over the files
    • translatorFunctions.py
    • utils.py
    • languages.json
  2. Install the deep-translator python library and add it to your requirements.txt
  3. create an event that calls the handle_reaction_transaltion function

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages