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 PlatformAdapter for pcfg.

Return type:

PlatformAdapter

Parameters:
class main.BotRunner(cfg, tool_registry)[source]

Bases: object

Encapsulates bot state so the web GUI can start / stop individual platforms on demand.

Parameters:
__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:

bool

property client: Any

Client.

Returns:

The result.

Return type:

Any

property credentials: dict | None

Credentials.

async start()[source]

Start all platform adapters concurrently.

Return type:

None

async start_platform(platform_name)[source]

Start a specific platform adapter by name.

Return type:

None

Parameters:

platform_name (str)

async stop()[source]

Stop all platform adapters and clean up.

Return type:

None

async stop_platform(platform_name)[source]

Stop a specific platform adapter by name.

Return type:

None

Parameters:

platform_name (str)

get_adapter(platform_name)[source]

Return the adapter for platform_name, or None.

Return type:

PlatformAdapter | None

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 IncomingMessage from event_data, and enqueues it for processing through the normal message queue.

Raises ValueError if the adapter is not found or not running.

Return type:

None

Parameters:
async main.main()[source]

Main.

Return type:

None