zephyr.songbird

In-process voice playback. Plays files from the module's `zephyr.io` sandbox. Requires the `songbird` permission; declare `services = ["songbird"]` for production. Only one backend (Songbird or Lavalink) may own a guild voice session at a time.

7 functions

connect

songbird
zephyr.songbird.connect(guild_id, channel_id)

Join a voice channel.

Parameters

guild_idstring

Guild id.

channel_idstring

Voice channel id to join.

Returns

nil

Nothing.

Raises an error if

  • the songbird permission is not granted
  • Lavalink already owns this guild's voice session

disconnect

songbird
zephyr.songbird.disconnect(guild_id)

Leave voice and release the guild backend owner.

Parameters

guild_idstring

Guild id.

Returns

nil

Nothing.

Raises an error if

  • the songbird permission is not granted

play_file

songbird
zephyr.songbird.play_file(guild_id, path, options?)

Play an audio file from the module sandbox.

Parameters

guild_idstring

Guild id.

pathstring

Virtual zephyr.io path to an audio file.

optionstableoptional

channel_id (required if not already connected) and volume (multiplier; 1.0 is normal).

Returns

table

Playback table with track_id, path, and status.

Raises an error if

  • the songbird permission is not granted

Example

lua
zephyr.songbird.play_file(ctx.guild_id, "/cache/song.mp3", { volume = 0.75 })

pause

songbird
zephyr.songbird.pause(guild_id)

Pause playback.

Parameters

guild_idstring

Guild id.

Returns

nil

Nothing.

Raises an error if

  • the songbird permission is not granted

resume

songbird
zephyr.songbird.resume(guild_id)

Resume paused playback.

Parameters

guild_idstring

Guild id.

Returns

nil

Nothing.

Raises an error if

  • the songbird permission is not granted

stop

songbird
zephyr.songbird.stop(guild_id)

Stop the current track but stay connected.

Parameters

guild_idstring

Guild id.

Returns

nil

Nothing.

Raises an error if

  • the songbird permission is not granted

volume

songbird
zephyr.songbird.volume(guild_id, value)

Set the playback volume multiplier.

Parameters

guild_idstring

Guild id.

valuenumber

Volume multiplier; 1.0 is normal volume.

Returns

nil

Nothing.

Raises an error if

  • the songbird permission is not granted