https://github.com/tacticaltechjay/translator
https://github.com/tacticaltechjay/translator
discord-bot eris-discord-bot javascript js
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/tacticaltechjay/translator
- Owner: TacticalTechJay
- Created: 2021-05-20T06:10:35.000Z (about 5 years ago)
- Default Branch: production
- Last Pushed: 2022-03-11T03:35:22.000Z (over 4 years ago)
- Last Synced: 2025-06-02T10:03:47.221Z (about 1 year ago)
- Topics: discord-bot, eris-discord-bot, javascript, js
- Language: JavaScript
- Homepage:
- Size: 251 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Config
This bot is configurable through environmental variables that can be defined like so:
```
PREFIX=! node index.js
```
These are the following variables that you are required to set:
|Config | Default |Description|
|--------|---------|-----------|
|`TLURL` |"localhost"|Base URL to your own [LibreTranslate](https://github.com/LibreTranslate/LibreTranslate)|
|`PORT` | "80" |Used for a translator api *if* it is hosted locally on your computer. **Used with default `TLURL` and if it was not previously defined.**|
|`PREFIX`| "!" |The prefix used to interact with the discord bot.|
|`DISCORD_TOKEN`|""|A discord token for running a discord bot. Refer [here](https://discord.com/developers/docs/intro#bots-and-apps). **Not an optional variable.**|
|`DATABASE_URL`|""|A database URL used for [Prisma](https://prisma.io) to store a guild's config. **Not an optional variable.**|
# Installing and Running
Hold onto your environmental variables, there are some prerequisites to using this discord bot.
- A selfhosted [LibreTranslate](https://github.com/LibreTranslate/LibreTranslate) API
- NodeJS
- NPM
- A database that Prisma [supports](https://www.prisma.io/docs/reference/database-reference/supported-databases).
- A Discord Account.
Everything checks out? Ok, now to get with setting this mayhem up!
1. Initial setup
Install all dependencies
```shell
npm install
```
Generate Prisma Client
```shell
npx prisma generate
```
2. Prepare your environemtnal variables!
Run the bot!
```shell
TLURL="https://libretranslate.com" PREFIX="tl!" DISCORD_TOKEN="totallylegittoken" DATABASE_URL="postgresql://johndoe:randompassword@localhost:5432/mydb?schema=public" node index.js
```