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
Values like TEAM_SIZE, TEAM_COUNT and so on are currently set via environment variables, stored in .env. This is not the way I want to handle this going forward. Ideally, the bot should support dynamic configuration commands like ~set team_size 4 and ~set game_title overwatch and so forth.
One possible way to do this is via config files:
config-rs: Supports multiple file formats, as well as hierarchical configuration
toml-rs: Basically the serde_json of TOML format. Would involve a lot rolling our own implementation.
Another way would be to store default per-title (e.g. Overwatch, LawBreakers, etc.) configuration information in the database and load them that way, and support mutating those values via the aforementioned commands. For example, there'd be a table like
from which the bot would read. Those values would get stored to like a Config struct. Then the hypothetical set serenity command would mutate those values based on the args to set. (Obviously there'd have to be some permissions-checking of the command-sender to avoid trouble-making.)
The text was updated successfully, but these errors were encountered:
This is marked as post-1.0 just to indicate it's not something I will work on before the 1.0 release, but if a contributor wants to dive in on it, go ahead.
config-rs is nice because it doesn't tie you down to any format, so if something doesn't work as well as you'd hope, you can just switch. You can also do combo config files made up of different types if per say you wanted to store some data in json, and config variables in toml.
Values like
TEAM_SIZE
,TEAM_COUNT
and so on are currently set via environment variables, stored in.env
. This is not the way I want to handle this going forward. Ideally, the bot should support dynamic configuration commands like~set team_size 4
and~set game_title overwatch
and so forth.One possible way to do this is via config files:
serde_json
of TOML format. Would involve a lot rolling our own implementation.Another way would be to store default per-title (e.g. Overwatch, LawBreakers, etc.) configuration information in the database and load them that way, and support mutating those values via the aforementioned commands. For example, there'd be a table like
from which the bot would read. Those values would get stored to like a
Config
struct. Then the hypotheticalset
serenity command would mutate those values based on the args toset
. (Obviously there'd have to be some permissions-checking of the command-sender to avoid trouble-making.)The text was updated successfully, but these errors were encountered: