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_musictool. Unpauses the Lyria generative-music session for the given guild so audio playback continues wherepause_musicleft 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 toctx.adapter.lyria_service.resumewith 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_tooldispatch:tool_loader.pydiscovers this module by itsTOOL_NAME/TOOL_DESCRIPTION/runcontract and registersrunas 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) – TheToolContextfor the invocation, injected by the registry. Must carry a non-Noneadapter; 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_idis invalid.- Return type: