tools.pause_music module
Pause the active Lyria music stream in a Discord voice channel.
- async tools.pause_music.run(guild_id, ctx=None)[source]
Pause the active Lyria RealTime music stream for a guild.
Implements the
pause_musictool. It does not generate audio itself; instead it resolves the Discord client and the Lyria service hanging off the platform adapter and asks Lyria to suspend the in-progress generation so it can later be resumed withresume_musicwithout tearing down the voice connection.Validates that a Discord-capable context was supplied (
ctx.adapter), fetches the livediscord.Clientviatools._discord_helpers.get_discord_client(returning that helper’s error string if the client is unavailable), coercesguild_idto an int, and then delegates toctx.adapter.lyria_service.pause, whose return string is passed straight back to the model. It is registered and dispatched dynamically bytool_loader.pyas the module-levelrunhandler; no in-repo callers invoke it directly outside of tests.- Parameters:
guild_id (
str) – Discord server (guild) ID as a string; rejected if it cannot be parsed as an integer.ctx (
ToolContext|None) – The tool execution context. Must expose a non-Noneadapterwith alyria_service; otherwise an error string is returned.
- Returns:
The Lyria service’s status message on success, or an
Error:prefixed string when the adapter is missing, the Discord client is unavailable, orguild_idis invalid.- Return type: