You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The bot needs persistent storage, but not enough to justify a database (see #51). I believe the solution is to have a config file passed to the Bot object that it can read and write to. This can also help in doing config-only init (#39)
So the only decision i need to make is to standardize the format for config:
ini - a little obtuse, don't really care for this option
yaml
toml
json - hard to hand edit
Any thoughts?
The text was updated successfully, but these errors were encountered:
Well yaml is becoming increasingly standard for configuration files, which is a good reason to use it.
However, having the bot write to a configuration file seems a bit odd; normally configuration files are immutable, and tracked in a version control system. I have often wondered if it is possible to design a configuration system that simultaniously does both declarative and imperative configuration, but I don't think you would be interested in piloting such techniques with pinhook.
If I am right and this is undesirable, we should distinguish the usecases here:
configuring the bot declaratively
saving state derived from imperative actions
Assuming you want to stick to one configuration language, you could for example have an immutable config.yaml which is committed to git, and a mutable state.yaml which is not committed to git, where the bot can write various stuff, like banned users.
One way to deal with this is a secrets.yaml, but this may be annoying to have so many files. One way to do this is to offer the possibility to either have one or multiple yaml files as configuration; in the many case you would deep merge the resulting dicts to produce the full configuration.
Even without version control, I would still not like config.yaml to be mutable by the bot, at least not with banned users as the list can get big.
The bot needs persistent storage, but not enough to justify a database (see #51). I believe the solution is to have a config file passed to the Bot object that it can read and write to. This can also help in doing config-only init (#39)
So the only decision i need to make is to standardize the format for config:
Any thoughts?
The text was updated successfully, but these errors were encountered: