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

Inconsistent use of bot.settings in code and docs #2662

Open
dgw opened this issue Feb 26, 2025 · 0 comments
Open

Inconsistent use of bot.settings in code and docs #2662

dgw opened this issue Feb 26, 2025 · 0 comments
Milestone

Comments

@dgw
Copy link
Member

dgw commented Feb 26, 2025

After a question earlier today on IRC about how to access the bot config (bot.settings.sectionname vs config.sectionname), I took a brief look at some of our documentation about using settings.

First off, it's important to note that many builtins still reference bot.config—meaning anyone using the builtins as reference (which is part of what they're there for) will copy-paste the "old" style. Things should be updated to use bot.settings, and ultimately we could use a proper lifecycle plan for the bot.config attribute. It's "TODO" deprecated, not actually deprecated; we should perhaps have bot.settings also be a property, and store the actual Config in a sunder attr. (config is already a property, so in theory it would be easy to slap a @sopel.lifecycle.deprecated() decorator on it.)

More importantly, any places in the docs or website that refer to bot.config should be updated.

And finally, the sopel.config.types page has a very unclear example right at the top, the source of our IRC visitor's confusion: it shows just using config on its own.

Image

It's not immediately clear to a reader that this is about working with the config types outside the context of a bot. As we work on 8.1 we should keep an eye out for cases like this to clarify them and/or link to the relevant place in the Developer Overview section—here, the "Configuration and plugin setup" tutorial.

@dgw dgw added this to the 8.1.0 milestone Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant