This is a Telegram bot that enables you to generate some kind of pseudorandom values. For example, it has functionality for virtual "rolling the dice", "flipping coin", choice between set of options, etc.
- Golang compiler (with 1.13 or higher version)
- Docker CLI
- Redis (you may install it via Docker)
-
Install a Redis server:
docker run --name redis-test-instance -p 6379:6379 -d redis
-
Start the Redis server:
docker start redis-test-instance
-
Create a .env file and define Telegram token parameter:
RANDOM_BOT_TELEGRAM_TOKEN=<your token>
-
Build and launch an application
Run the following command:
docker build -t <build tag> .
You will get an application image. Then if need to run it, use "docker run" command. For example:
docker run --name redis-test-instance <build tag> \
-e RANDOM_BOT_TELEGRAM_TOKEN=<token>
Run the following command:
go build
You will get an executable file with name "main".
Launching the application:
./main
-
Find new strings to translate:
goi18n extract -outdir locale/assets goi18n merge -outdir locale/assets locale/assets/active.*.toml
You will get "translate.<language code>.toml" files with strings that translations need to be updated.
-
Edit translations files
-
Merge the translations into active files:
goi18n merge -outdir locale/assets locale/assets/active.*.toml locale/assets/translate.*.toml
-
(Optional) Remove "translate.*.toml" files:
rm locale/assets/translate.*.toml
-
Generate a file with all strings to translate:
goi18n extract -outdir locale/assets -sourceLanguage <language code>
-
Edit the translations file
-
Merge translations (this command will append hash codes of the strings):
goi18n merge -outdir locale/assets locale/assets/active.*.toml