Overview of NoneBot Dependency Injection
NoneBot uses a dependency injection system to provide context information (like the current Bot, Event, and State) to event handlers. This system consists of two phases: parameter parsing (where function arguments are analyzed to identify dependencies and converted into Dependent objects) and execution (where the identified dependencies are resolved and their return values are passed into the handler).
Crucially, type annotations are used to determine which dependency to inject. If the type annotation does not match the actual data type provided, the handler will be skipped due to the overload mechanism. For debugging dependency resolution, set the log-level configuration to TRACE.