All Projects → Cog-Creators → Red-Lavalink

Cog-Creators / Red-Lavalink

Licence: GPL-3.0 license
Lavalink client library used in Red-DiscordBot

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Red-Lavalink

tmerc-cogs
Cogs for the Red Discord bot.
Stars: ✭ 35 (+59.09%)
Mutual labels:  red-discordbot, discord-py
palmtree5-cogs
No description or website provided.
Stars: ✭ 19 (-13.64%)
Mutual labels:  red-discordbot, discord-py
Music-Discord-Bot
A music Discord bot with more than 30+ commands which allows to play music on your server efficiently. Supports Youtube, Spotify, Deezer and Soundcloud links. Skips intros and blanks in the music with Sponsorblock.
Stars: ✭ 57 (+159.09%)
Mutual labels:  discord-py, lavalink
Kreusada-Cogs
Cogs for Red-DiscordBot
Stars: ✭ 26 (+18.18%)
Mutual labels:  red-discordbot, discord-py
table2ascii
Python library for converting lists to fancy ASCII tables for displaying in the terminal and on Discord
Stars: ✭ 31 (+40.91%)
Mutual labels:  discord-py
discord-py-heroku
Starter kit for hosting a Discord bot on Heroku
Stars: ✭ 85 (+286.36%)
Mutual labels:  discord-py
Vale.py
A bot to support Discord servers that I like.
Stars: ✭ 14 (-36.36%)
Mutual labels:  discord-py
Karuma
Karuma is a Discord Bot including Nukes, Raids, Mass DM and other features. Only for educational purposes 🥱🚀
Stars: ✭ 132 (+500%)
Mutual labels:  discord-py
discord-bots
Repo for the source code of DuckBot, and my other Discord bots!
Stars: ✭ 32 (+45.45%)
Mutual labels:  discord-py
lavalink
A custom version of lavalink with more features
Stars: ✭ 66 (+200%)
Mutual labels:  lavalink
nextcord
A Python wrapper for the Discord API forked from discord.py
Stars: ✭ 956 (+4245.45%)
Mutual labels:  discord-py
spotilink
Parse Spotify URLs into Lavalink track objects.
Stars: ✭ 22 (+0%)
Mutual labels:  lavalink
MudaeAutoBot
python bot that uses strictly the **Discord API** to Roll,Claim,and Kakera Snipe in Mudae. 5/10/21 project converted over to discum library
Stars: ✭ 102 (+363.64%)
Mutual labels:  discord-py
flare-cogs
Various cogs written for Red-DiscordBot
Stars: ✭ 71 (+222.73%)
Mutual labels:  red-discordbot
Discord-Study-Bot
Discord-Study-Bot is a Study-Time-based leaderboard system in discord servers. This features an Overall leaderboard and leaderboards based on a Daily, Weekly, and Monthly basis.
Stars: ✭ 20 (-9.09%)
Mutual labels:  discord-py
distest
A library used to do integration testing on discord bots
Stars: ✭ 29 (+31.82%)
Mutual labels:  discord-py
opensource-discordbots
Curated list of awesome open-source Discord Bots
Stars: ✭ 19 (-13.64%)
Mutual labels:  discord-py
DingoLingo
A Discord music bot written in Python with support for Youtube, SoundCloud, Spotify, Bandcamp, Twitter, and custom files.
Stars: ✭ 183 (+731.82%)
Mutual labels:  discord-py
TearDrops
A sad discord bot made using discord.py
Stars: ✭ 13 (-40.91%)
Mutual labels:  discord-py
Toxic-Cogs
A collection of utility, moderation and fun plugins to Red - Discord Bot.
Stars: ✭ 43 (+95.45%)
Mutual labels:  red-discordbot

Red-Lavalink

Travis CI status Documentation Status Code style: black

A Lavalink client library written for Python 3.8 using the AsyncIO framework. This library may be used for other projects as it contains no Red specific code or logic.

However, it is important to note that this library only supports projects using discord.py.

To install:

pip install red-lavalink

Usage

import lavalink
from discord.ext.commands import Bot


class MyBot(Bot):
    async def setup_hook(self):
        await lavalink.initialize(
            self, host='localhost', password='password', port=2333
        )


async def search_and_play(voice_channel, search_terms):
    player = await lavalink.connect(voice_channel)
    tracks = await player.search_yt(search_terms)
    player.add(tracks[0])
    await player.play()

Shuffling

def shuffle_queue(player_id, forced=True):
    player = lavalink.get_player(player_id)
    if not forced:
        player.maybe_shuffle(sticky_songs=0)
        """
        `player.maybe_shuffle` respects `player.shuffle`
        And will only shuffle if `player.shuffle` is True.

        `player.maybe_shuffle` should be called every time
        you would expect the queue to be shuffled.

        `sticky_songs=0` will shuffle every song in the queue.
        """
    else:
        player.force_shuffle(sticky_songs=3)
        """
        `player.force_shuffle` does not respect `player.shuffle`
        And will always shuffle the queue.

        `sticky_songs=3` will shuffle every song after the first 3 songs in the queue.
        """

When shutting down, be sure to do the following:

await lavalink.close(bot)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].