tools.resume_music module

Resume a paused Lyria music stream in a Discord voice channel.

async tools.resume_music.run(guild_id, ctx=None)[source]

Resume a previously paused Lyria music stream in a Discord guild.

Module-level entry point for the resume_music tool. Unpauses the Lyria generative-music session for the given guild so audio playback continues where pause_music left off, without tearing down or re-establishing the voice connection.

Validates that a Discord adapter is present on the context, obtains the live discord.py client via get_discord_client (bailing out with that helper’s error string if the gateway is unreachable), then delegates to ctx.adapter.lyria_service.resume with the parsed integer guild id. The actual side effect – resuming the audio stream in the voice channel – happens inside the Lyria service.

Called by the tool registry’s execute_tool dispatch: tool_loader.py discovers this module by its TOOL_NAME/TOOL_DESCRIPTION/run contract and registers run as the tool handler, so there are no direct in-repo callers.

Parameters:
  • guild_id (str) – Discord server (guild) ID as a string; it is converted to an integer before being passed to the Lyria service.

  • ctx (ToolContext | None) – The ToolContext for the invocation, injected by the registry. Must carry a non-None adapter; otherwise an error string is returned.

Returns:

The Lyria service’s human-readable result message on success, or an error string when the adapter, Discord client, or guild_id is invalid.

Return type:

str