Skip to main content

No project description provided

Project description

Salad

License: GPL Python Code style: black Discord

Salad is a lightning-fast, completely asynchronous Python framework designed for effortless Lavalink integration with discord.py. With full Lavalink specification support, clean API architecture, and robust integrated Spotify and Apple Music functionality, Salad enables creators to craft outstanding music bots effortlessly.

Developed as an improved fork of AquaLink, Salad provides enhanced performance and developer satisfaction.

Essential Resources

Setup Instructions

Requires Python 3.8 or newer and current pip version.

Production Version (Suggested)

pip install salada

Bleeding Edge (Newest Features)

pip install git+https://github.com/ToddyTheNoobDud/salad

Quick Start Guide

Browse detailed examples in the examples folder

Here's a basic starter code:

import discord
from discord.ext import commands
from discord import app_commands
from salada import Salad

INTENTS = discord.Intents.default()
INTENTS.message_content = True
INTENTS.voice_states = True

NODES = [{
    'host': '127.0.0.1',
    'port': 50166,
    'auth': 'youshallnotpass',
    'ssl': False
}]

class MusicBot(commands.Bot):
    def __init__(self):
        super().__init__(command_prefix='!', intents=INTENTS)
        self.salad = None

    async def setup_hook(self):
        self.salad = Salad(self, NODES)
        await self.salad.start(NODES, str(self.user.id))
        await self.tree.sync()

bot = MusicBot()

@bot.tree.command(name='play')
@app_commands.describe(query='Song name or URL')
async def play(interaction: discord.Interaction, query: str):
    await interaction.response.defer()

    if not interaction.user.voice:
        await interaction.followup.send('❌ Join a voice channel first!')
        return

    player = bot.salad.players.get(interaction.guild.id)

    if not player:
        player = await bot.salad.createConnection({
            'guildId': interaction.guild.id,
            'voiceChannel': interaction.user.voice.channel.id,
            'textChannel': interaction.channel.id
        })
        await interaction.user.voice.channel.connect()

    result = await bot.salad.resolve(query, requester=interaction.user)
    tracks = result.get('tracks', [])

    if not tracks:
        await interaction.followup.send('❌ No tracks found!')
        return

    track = tracks[0]
    player.addToQueue(track)

    if not player.playing:
        await player.play()
        await interaction.followup.send(f'▶️ Now playing: **{track.title}**')
    else:
        await interaction.followup.send(f'➕ Added: **{track.title}**')

bot.run('YOUR_BOT_TOKEN_HERE')

Common Questions

How do I configure Lavalink initially?

  • Salad needs an active Lavalink server to operate. Get the newest Lavalink build here, set up your application.yml, and launch the server prior to starting Salad in your application.

What skills do I need to use Salad?

  • You need moderate Python knowledge, strong understanding of async programming patterns, and practical discord.py experience. Knowledge of music bot design is beneficial but not essential.

My application can't locate the Salad package. What should I do?

  • This usually indicates Salad isn't present in your Python setup. Execute pip install salad or follow the setup commands above. When working with virtual environments, verify you've enabled the appropriate one.

Why should I choose Salad over alternative Lavalink packages?

  • Salad delivers exceptional speed, a user-friendly and thoroughly documented API, consistent updates featuring current Lavalink capabilities, native compatibility with popular streaming services, and a vibrant Discord community prepared to assist.

Can Salad work with Lavalink extensions?

  • Absolutely! Salad keeps complete alignment with the Lavalink specification, including extension compatibility. You can utilize any Lavalink extension smoothly with Salad.

Acknowledgments

Appreciation to southctrl for creating filters and enums!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

salada-1.1.0.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

salada-1.1.0-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file salada-1.1.0.tar.gz.

File metadata

  • Download URL: salada-1.1.0.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for salada-1.1.0.tar.gz
Algorithm Hash digest
SHA256 978f026ab4a9f1dd5c1dc673b7f0ea6d749af82c584c782498f657f4f72beb62
MD5 5ae11a7fc953cb72a401cb5f931e72b1
BLAKE2b-256 059890d3842022961557b5631c77ddb594fd045dc6d3001ffd6d516809089124

See more details on using hashes here.

File details

Details for the file salada-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: salada-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for salada-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 95cc6c2895028bd5ccb827d4749435fd8c01184c346e3af8e861b145df0e3828
MD5 6ce239066fff6c542a189047e2d816b2
BLAKE2b-256 359e2e3f93629c02dc3c90226d0b80f3f7d891999282af6cf8278bf76a5f3a4b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page