Music

Codyx can play music from various sources like YouTube and SoundCloud directly in your server's voice channels.

Prerequisites

  • Lavalink Server: The music feature relies on a Lavalink server. Ensure that a Lavalink server is running and that the bot is correctly configured to connect to it via environment variables (LAVALINK_HOST, LAVALINK_PORT, LAVALINK_PASSWORD, LAVALINK_SECURE).
  • Bot Permissions: Codyx needs the Connect and Speak permissions in the voice channels it will be used in.

Configuration (Web Dashboard)

Configure music settings via the Web Dashboard under the "Music" section:

  • Enable Music Feature: Toggle this switch to enable or disable all music commands for the server.
  • Allowed Text Channels: Use the multi-select dropdown to specify which text channels users are allowed to use music commands in (e.g., /play). If left blank, commands can be used in any text channel.
  • Allowed Voice Channels: Use the multi-select dropdown to specify which voice channels the bot is allowed to join. If left blank, the bot can join any voice channel it has permissions for.
  • DJ Roles: Select one or more roles using the multi-select dropdown. Users with these roles typically gain access to commands that control playback for everyone, such as /skip, /stop, and potentially others like volume or queue management (if implemented).

Commands

Music commands must typically be used while you are in a voice channel.

  • /play query:<song name or URL>
    • Joins your current voice channel (if not already in one on the server).
    • Searches for the song/video on platforms like YouTube or SoundCloud, or plays directly from a URL.
    • If a song is already playing, it adds the requested track to the end of the queue.
    • The bot will announce which track is starting in the text channel where the command was used.
  • /skip
    • Skips the currently playing song and starts the next one in the queue.
    • Typically requires the user to have a configured DJ Role or be the song requester (depending on implementation).
  • /stop
    • Stops the music playback completely.
    • Clears the current queue.
    • Disconnects the bot from the voice channel.
    • Typically requires the user to have a configured DJ Role.
  • /queue
    • Displays the list of songs currently waiting in the queue.
  • /leave
    • Disconnects the bot from its current voice channel. This may or may not clear the queue (/stop usually does both).
    • Typically requires the user to have a configured DJ Role or be alone with the bot.

Voice Channel Requirement: Users generally need to be in a voice channel to use commands like /play. The bot joins the user's current channel.

Ensure the Lavalink server is running and accessible to the bot. Connectivity issues between the bot and Lavalink are a common cause of music feature failures.