Skip to content

peunsu/discord-deepl-translator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

discord-deepl-translator

Translator application for Discord using DeepL API.

Installation

  • Python 3.8 or higher is required
  • Clone the repo:
$ git clone https://github.com/peunsu/discord-deepl-translator
  • Create the virtual environment (optional):
$ python -m venv venv
$ source venv/bin/activate
  • Install requirements:
$ pip install -r requirements.txt
BOT_TOKEN = "your_bot_token"
DEEPL_KEY = "your_deepl_api_key"
  • Set up your config.json as shown in the example below:
{
    "translator": {
        # The language into which the text should be translated. Refer to the DeepL API Docs(https://www.deepl.com/docs-api/translate-text).
        "target_lang": "KO"
    },
    "relay": {
        # Relay the message from "input" to "output".
        # You can set "custom_key" whatever you want.
        # The app translates messages sent from "input" channels and sends them to "output" channel.
        # When send the translated messages, mention the "role" you set below.
        "custom_key": {
            "input": [1234567890123456789, 1234567890123456789, 1234567890123456789],
            "output": 1234567890123456789,
            "role": 1234567890123456789
        },
        ...
    },
    "messages": {
        # Customize your bot messages and the footer icon.
        "translate_button": "Translate",
        "translate_complete": "Translated the text!",
        "original_footer": "Original Message",
        "translated_footer": "Translated by DeepL Translator",
        "footer_icon_url": "https://i.imgur.com/sg8WDCE.png"
    }
  • Run the application:
$ python app.py

About

Translator application for Discord using DeepL API.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages