main
Entry point for the multi-platform LLM bot.
Handles tool auto-loading, prompt rendering, platform instantiation, and the web management GUI.
- main.create_platform(pcfg, message_handler, media_cache=None, message_update_handler=None, message_delete_handler=None, config=None, reaction_update_handler=None)[source]
Instantiate the correct
PlatformAdapterfor pcfg.- Return type:
- Parameters:
- class main.BotRunner(cfg, tool_registry)[source]
Bases:
objectEncapsulates bot state so the web GUI can start / stop individual platforms on demand.
- Parameters:
cfg (Config)
tool_registry (ToolRegistry)
- __init__(cfg, tool_registry)[source]
Initialize the instance.
- Parameters:
cfg (
Config) – Bot configuration object.tool_registry (
ToolRegistry) – The tool registry value.
- Return type:
None
- property is_running: bool
Check whether is running.
- Returns:
True on success, False otherwise.
- Return type:
- get_adapter(platform_name)[source]
Return the adapter for platform_name, or
None.- Return type:
- Parameters:
platform_name (str)
- async handle_webhook(platform_name, channel_id, event_data)[source]
Inject an external webhook event into the message pipeline.
Looks up the named platform adapter, builds an
IncomingMessagefrom event_data, and enqueues it for processing through the normal message queue.Raises
ValueErrorif the adapter is not found or not running.