|
|
||
|---|---|---|
| src | ||
| .gitignore | ||
| Makefile | ||
| README.md | ||
| config.exemple.toml | ||
| docker-compose.yaml | ||
| package.json | ||
| tsconfig.json | ||
| yarn.lock | ||
README.md
Discord Bot Template
Translate command for Another Child Spring server
Command Usage
Name
translate - Translate a message into the selected language
Syntax
translate [lang] [message]
Description
The translate command will call the Deepl API to translate the message into the chosen lang. The lang parameter can simply be the destination language (source language is automatically detected) but if the user wants to specify the source language it can be formatted like so: src->dst
Limitation
- Deepl API limit to 500.000 characters/month for the free version
Requirement
How to install
DeeplAPI
- Create an account on Deepl API
- Generate a token
Project
- Clone the repo
- Copy the
config.exemple.tomland rename itconfig.toml - Launch the docker container with
make startordocker-compose up -d - Go into the docker container with
make shellordocker-compose exec discord-bot bash - Install the dependencies:
yarn install - Compile typescript and run the bot with
yarn dev
Notes
- Configuration file format is TOML. It is a minimal configuration file format that's easy to read due to obvious semantics. TOML is designed to map unambiguously to a hash table. TOML should be easy to parse into data structures in a wide variety of languages. Read
src/config.tsto see all possibilities. - Project use Inhibitor from
Sheweny. Inhibitor is a kind of middleware for command. Inhibitors allow you to limit the use of a command, an event, or an interaction.
Contributions/License
This project has an AGPLv3 license. This project use the Sheweny framework with discord.js underlying and BinaryMuse/toml-node for configuration parsing. To communicate with DeeplAPI, project use the offical javascript wrapper.