Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
cyrmax opened this issue Dec 4, 2022 · 1 comment

Comments

@cyrmax
Copy link
Collaborator

cyrmax commented Dec 4, 2022

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
Copy link
Collaborator Author

cyrmax commented Dec 4, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant