Sign inSign up

kalithekitsune/open-discord-translator

By kalithekitsune

•Updated almost 3 years ago

A discord bot integrating with the latest discord features with multiple translation backend

Image
0

1.3K

kalithekitsune/open-discord-translator repository overview

⁠open discord translator

An open source discord bot using the latest discord integration features and supporting multiple translation backend

⁠Features

⁠Translation Command
⁠Directly send the translated message
⁠Context menu translation

⁠Installation

Create a docker-compose.yml file and set the environment variables (check the Environment variables⁠ section for more information)

version: "3.7"
services:
  open-discord-translator:
    container_name: open-discord-translator
    image: ghcr.io/kalitsune/open-discord-translator:latest
    restart: always
    environment:
      - TOKEN=[your token here] # https://discord.com/developers/applications
      - GUILD= # if set, the commands will only be available in this guild whose ID is linked here
      - SKIP_COMMAND_VALIDATION=false # if set to true, the bot will not check if the commands are up to date
      - ACCENT_COLOR=Blurple # the color of the embeds
      - DELETE_BUTTON_TIMEOUT=10 # the time in s before the delete button disappears (leave empty for infinite)
      - TRANSLATION_API_DRIVER=google # paid_google.js or deepl
      - SELECTED_LANGUAGES=en,es,fr,de,it,ja,ko,pt,ru,zh-CN,zh-TW,pl,nl,sv,ar,cs,da,fi,el,hi,hu,id,no,la,ro # the languages you want to translate to and from (comma separated)
      - GOOGLE_API_KEY= # your google API key (paid google driver)
      - DEEPL_API_KEY= # your deepl auth key (deepl driver)
      - DATABASE_PATH=database.sqlite # the path to the database file
      - DATABASE_DRIVER=sqlite # sqlite is the only driver supported for now but feel free to add more
    volumes:
      - open-discord-translator:/app/database.sqlite
volumes:
  open-discord-translator:

then start the bot

docker-compose up -d

to invite the bot, use the link printed in the console

⁠Docker cli
docker volume create open-discord-translator
docker run -d \
    --name open-discord-translator \
    -e TOKEN=[your token here] \
    -e GUILD= \
    -e SKIP_COMMAND_VALIDATION=false \
    -e ACCENT_COLOR=Blurple \
    -e DELETE_BUTTON_TIMEOUT=10 \
    -e TRANSLATION_API_DRIVER=google \
    -e SELECTED_LANGUAGES=en,es,fr,de,it,ja,ko,pt,ru,zh-CN,zh-TW,pl,nl,sv,ar,cs,da,fi,el,hi,hu,id,no,la,ro \
    -e GOOGLE_API_KEY= \
    -e DEEPL_API_KEY= \
    -e DATABASE_PATH=database.sqlite \
    -e DATABASE_DRIVER=sqlite \
    -v open-discord-translator:/app/database.sqlite \
    ghcr.io/kalitsune/open-discord-translator:latest

to invite the bot, use the link printed in the console

⁠Environment variables
VariableDescriptionDefault value
TOKENThe discord bot tokennone
GUILDThe guild ID where the bot will be restricted tonone
SKIP_COMMAND_VALIDATIONIf set to true, the bot will not check if the commands are up to datefalse
ACCENT_COLORColor used for the bot embeds can be a number, hex or one of those⁠Blurple
DELETE_BUTTON_TIMEOUTThe time in seconds before the delete button for the send disappear (leave empty for infinite)10
TRANSLATION_API_DRIVERThe translation API to use (check supported drivers⁠)google
SELECTED_LANGUAGESThe languages to use for the translation command, if empty, the first 25 supported languages returned by the translation driver will be used[CSV, check .env]
GOOGLE_API_KEYYour google api key⁠, only needed if you use the google paid translation API⁠none
DEEPL_API_KEYYour deepl auth key, only needed if you use the deepl translation API⁠none
DATABASE_DRIVERThe database driver to use (check supported drivers⁠)sqlite
SQLITE_PATHThe path to the sqlite database file, only needed if you use the sqlite database driver⁠./database.sqlite
⁠Translation API drivers
Driver nameDescription
googleThe google translation API for free, the threshold might be low
paid_googleThe google translation API, you need to set the GOOGLE_API_KEY environment variable
deeplThe deepl translation API, you need to set the DEEPL_API_KEY environment variable
⁠Database API drivers
Driver nameDescription
sqliteThe sqlite database driver, you need to set the SQLITE_PATH environment variable

Tag summary

Content type

Image

Digest

sha256:70a43e1c7…

Size

401.5 MB

Last updated

almost 3 years ago

docker pull kalithekitsune/open-discord-translator