gumerov-amir / TTMediaBot

A bot for music streaming to TeamTalk Servers.
https://ttmediabot.ru
MIT License
58 stars 65 forks source link

Feature request: use toml instead of json as a configuration file format #80

Open cyrmax opened 1 year ago

cyrmax commented 1 year ago

Hello. I offer to use toml format instead of json format for config file. Toml is more readable, less prone to mistakes and typos. Also toml file can have comments; that will give us an oportunity to make config file self-documented.

cyrmax commented 1 year ago

After few hours of research i found several problems. They should be discussed. TTMediaBot during it's operation can sometimes resave the configuration in response to admin commands. When config is resaved any comments inside file are eliminated and sections are reordered. We should decide if it is a problem or not. Should configuration file be fully human readable and commented only before first bot usage (for documentation and tutorial purposes) or we have to keep propper order and comments always?

BTW, I see the bigger problem in the way we work with configuration file. We try to keep config file readable and want user to edit it. But at the same time we change and resave config during bot's operation. It is not a unix way. Configuration file should be either editable by user and read only at bot startup (like all unix programs behave) or shouldn't be editable by user at all. In the second variant we should create a tool for user to be able to edit configuration when bot is not started.

@gumerov-amir @a11cf0 let's think about it.