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

Option to read bot configuration from file #185

Open
samip5 opened this issue Dec 4, 2021 · 4 comments
Open

Option to read bot configuration from file #185

samip5 opened this issue Dec 4, 2021 · 4 comments

Comments

@samip5
Copy link

samip5 commented Dec 4, 2021

I would like to see an global config system, that would help with getting customizable command prefix.

@vranki
Copy link
Owner

vranki commented Dec 6, 2021

What does this mean in practice?

@samip5
Copy link
Author

samip5 commented Dec 6, 2021

What does this mean in practice?

It would mean that all of the things are configurable via a config file, like command prefix (shouldn't be hardcoded to !), ability to add storage (sqlite for example, which is needed for encryption), and the main running of the app would need to use the config values if present, and only fallback to environment variables if config doesn't have those.

@vranki vranki changed the title Global config system Option to read bot configuration from file Dec 6, 2021
@vranki
Copy link
Owner

vranki commented Dec 6, 2021

Ok, I'd accept a PR for this but by design Hemppa by default must work with no config file and everything (excluding basic params currently in env variables) must be configurable interactively with commands.

@xPMo
Copy link
Collaborator

xPMo commented Dec 13, 2021

It would mean that all of the things are configurable via a config file

The only local state we try and store is login information. We keep as much as possible in user data on the connected matrix server (if we add support for changing the prefix, we'd store it there too). My bot has a lot of state (about 200 meaningful entries* in !bot export), but to run it locally I just need 4 env variables. Hence I don't think the added complexity is worth it.

(* 200 meaningful entries:)

❯ wl-paste | jq 'flatten | add | with_entries(select(.value and .value != {} and .value != []))' | wc
    193     584    5545

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

3 participants