Merged
Conversation
Bot.start()
561eb1b to
1659c11
Compare
1659c11 to
4537328
Compare
chrisdedman
reviewed
Apr 6, 2026
Contributor
chrisdedman
left a comment
There was a problem hiding this comment.
Could you either add an example or update the current examples (or one example) to reflect this change?
Contributor
Author
I did, there's an example in the description of the PR. The doc will be changed after it's merged. I might have forgotten the readme tho and examples, I'll change them. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, Bot required a config at instantiation time, forcing library users to have a config path available at import time. This made it awkward to define a bot as a module-level singleton — a common and natural pattern — without immediately binding it to a config file.
This PR removes
configfromBot.__init__and moves it toBot.start(), so users can now define and decorate their bot freely at module level and defer config to whenever they actually run it.Changes:
Bot.__init__no longer accepts a config argumentBot.start()now requires a Config instance or path string_load_configis private since it's an implementation detail of start CLI updated to pass config through bot.start(settings.config)Result: users can now define their bot as a clean singleton, decorate it freely, and let the runner handle the rest:
bot.run(config=Config(...)) ... bot.run(config="config/bot.yaml")