How noduspanic/dishka-disnake works
dishka-disnake adapts Disnake bot handlers and UI callbacks for Dishka dependency injection. The main flow is setup, Disnake dispatch, dependency resolution, then the application handler. The README documents the broader command and component support; sampled source confirms the injection, button, string-select, setup, and patch paths, while some documented subsystems were not sampled.
Main entry points: _async.py Async injection · commands Command adapters · injector/__init__.py Injection decorators · setup/__init__.py Dishka setup
Components 19
Disnake integration
- Dishka setup
dishka_disnake/setup/__init__.py - Injected Cog
dishka_disnake/cog.py - Parameter patch
dishka_disnake/patch.py
Command handlers
- Command adapters
dishka_disnake/commands - Slash commands
dishka_disnake/commands/slash.py - Context commands
dishka_disnake/commands/ctx_menus.py - Prefix commands
dishka_disnake/commands/ctx.py
UI components
- Button support
dishka_disnake/ui/button.py - Select support
dishka_disnake/ui/select - Modal support
dishka_disnake/ui/modal.py
Dependency injection
- Injection decorators
dishka_disnake/injector/__init__.py - Async injection
dishka_disnake/injector/wrap/_async.py - Sync injection
dishka_disnake/injector/wrap/_sync.py - Signature filtering
dishka_disnake/base/sign.py - Container state
dishka_disnake/state_management/__init__.py
Other components
- Bot developer
- Disnake runtime
- Dishka container
- Bot handlers
Connections 25
- Bot developer → Dishka setup: configures
- Dishka setup → Container state: stores container
- Dishka setup → Parameter patch: patches parameters
- Injected Cog → Parameter patch: checks patch
- Bot developer → Command adapters: declares commands
- Command adapters → Slash commands: provides
- Command adapters → Context commands: provides
- Command adapters → Prefix commands: provides
- Bot developer → Button support: defines callbacks
- Bot developer → Select support: defines callbacks
- Bot developer → Modal support: defines callbacks
- Slash commands → Async injection: wraps callbacks
- Context commands → Async injection: wraps callbacks
- Button support → Async injection: wraps callbacks
- Select support → Async injection: wraps callbacks
- Modal support → Async injection: wraps callbacks
- Injection decorators → Async injection: selects async
- Injection decorators → Sync injection: selects sync
- Async injection → Container state: reads container
- Sync injection → Container state: reads container
- Async injection → Dishka container: resolves dependencies
- Sync injection → Dishka container: resolves dependencies
- Injection decorators → Signature filtering: filters annotations
- Disnake runtime → Async injection: dispatches callbacks
- Async injection → Bot handlers: invokes handler