New Features for the YADUBot

Repository

https://github.com/astrophoto-kevin/YADUBot

New Features

Moving the settings of the bot into an external config file

The settings of the bots are now saved in a config file (config.json). The file is in json format, which allows a clear listing of the settings. The settings are loaded when the script is started and applied into the internal variables.

Screenshot of the config file
config_json.jpg

https://github.com/astrophoto-kevin/YADUBot/blob/master/config.json

 

Using gettext to translate the messages of the bot in other languages

As suggested by @helo the code could be simplified with the use of a language module.
I used gettext to implement the multi langual support and to get rid of the before used "if, else" querys. This step has improved the readability of the code and saved some lines of code.
The language files are stored in the locales folder and can now be updated and/or extended to other languages in a simple way without changing the code itself.

Screenshot of the German translation file
translations.jpg

 

Minor updates

Here and there minor improvements have been made to the code. I tried to make the code clearer. I also commented on previously uncommented lines/functions to make them easier to understand.

 

How to implement?

The update can be made with the YADUBot_setup script. Some parts of the script are using "sudo" so you will be prompted to enter your password if it is needed.
wget https://raw.githubusercontent.com/astrophoto-kevin/YADUBot/master/YADUBot_setup.sh

You need to make the script executable.
chmod +x YADUBot_setup.sh

And start it with
./YADUBot_setup.sh

The script will download all necessary files and unpack them in the current location.

Please note:
Backup / write down your settings! The script will overwite your current files.

 

GitHub Account

https://github.com/astrophoto-kevin

H2
H3
H4
Upload from PC
Video gallery
3 columns
2 columns
1 column
7 Comments