All Projects → PythonistaGuild → Wavelink

PythonistaGuild / Wavelink

Licence: mit
A powerful Lavalink library for Discord.py.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Wavelink

Automod Bot
Fun moderation economy bot discord.js
Stars: ✭ 41 (-64.96%)
Mutual labels:  discord-bot, music
Distube
A Discord.js v12 module to simplify your music commands and play songs with audio filters on Discord without any API key. Support YouTube, SoundCloud, Bandcamp, Facebook, and 700+ more sites
Stars: ✭ 73 (-37.61%)
Mutual labels:  discord-bot, music
Express
A discord.js bot for music and moderation free and open source
Stars: ✭ 54 (-53.85%)
Mutual labels:  discord-bot, music
Focabot
Music with seals!
Stars: ✭ 19 (-83.76%)
Mutual labels:  discord-bot, music
Botify
Discord bot that plays Spotify tracks and YouTube videos or any URL including Soundcloud links and Twitch streams
Stars: ✭ 86 (-26.5%)
Mutual labels:  discord-bot, music
Pvpcraft
PvPCraft Discord bot
Stars: ✭ 29 (-75.21%)
Mutual labels:  discord-bot, music
Yukiko
powerful Discord bot that includes XP system, Leaderboard, Music, Welcome and farewell message, Moderation, and much more!
Stars: ✭ 72 (-38.46%)
Mutual labels:  discord-bot, music
Discord Bot
A discord bot that can play music, moderate, log events and more
Stars: ✭ 127 (+8.55%)
Mutual labels:  discord-bot, music
Rem V2
Well, this is the rewrite of rem, now even cleaner and hopefully with less bugs
Stars: ✭ 81 (-30.77%)
Mutual labels:  discord-bot, music
Misaki
Misaki is Discord Bot designed for communities with commands ranging from gif based anime reactions, to head scratching trivia commands.
Stars: ✭ 78 (-33.33%)
Mutual labels:  discord-bot, music
Master Bot
A Discord music bot with playlist support, music quiz, saved playlists, lyrics, gifs and more
Stars: ✭ 204 (+74.36%)
Mutual labels:  discord-bot, music
Music Bot
Simple music bot with a full-blown queue system that is easy to understand
Stars: ✭ 102 (-12.82%)
Mutual labels:  discord-bot, music
Octave
Discord bot written in Java and Kotlin using JDA.
Stars: ✭ 156 (+33.33%)
Mutual labels:  discord-bot, music
Jeelangamusic
Discord bot with music functional. Play, skip, save music and etc!
Stars: ✭ 40 (-65.81%)
Mutual labels:  discord-bot, music
Discord Musicbot
Very simple discord music bot with the discord.js with Song Name playing. It can able to play music with the song name
Stars: ✭ 148 (+26.5%)
Mutual labels:  discord-bot, music
Musicbot
🎶 A Discord music bot that's easy to set up and run yourself!
Stars: ✭ 1,109 (+847.86%)
Mutual labels:  discord-bot, music
Karmabot
🤖 A Multipurpose Discord Bot with a Music System & Utility commands used by 160K+ users!
Stars: ✭ 73 (-37.61%)
Mutual labels:  discord-bot, music
Pengubot
Official PenguBot GitHub Repository
Stars: ✭ 98 (-16.24%)
Mutual labels:  discord-bot, music
Discord.js Musicbot Addon
This DOES NOT WORK any more. This repo only serves as an archive for is anyone wants to pickup my work. You may still join the discord however.
Stars: ✭ 109 (-6.84%)
Mutual labels:  discord-bot, music
Simple Sdl2 Audio
A simple SDL2 audio library without SDL_Mixer for playing music and multiple sounds natively in SDL2
Stars: ✭ 111 (-5.13%)
Mutual labels:  music

.. image:: logo.png?raw=true :align: center

.. image:: https://img.shields.io/badge/Python-3.7%20%7C%203.8-blue.svg :target: https://www.python.org

.. image:: https://api.codacy.com/project/badge/Grade/d020ed97fd2a46fcb1f42bd3bc397e63 :target: https://app.codacy.com/app/mysterialpy/Wavelink?utm_source=github.com&utm_medium=referral&utm_content=EvieePy/Wavelink&utm_campaign=Badge_Grade_Dashboard

.. image:: https://img.shields.io/github/license/EvieePy/Wavelink.svg :target: LICENSE

A robust and powerful Lavalink wrapper for Discord.py <https://github.com/Rapptz/discord.py>_!

Documentation

Official Documentation <https://wavelink.readthedocs.io/en/latest/wavelink.html#>_.

Support

For support using WaveLink, please join the official support server <https://discord.gg/RAKc3HF>_ on Discord <https://discordapp.com/>_.

|Discord|

.. |Discord| image:: https://img.shields.io/discord/490948346773635102?color=%237289DA&label=Pythonista&logo=discord&logoColor=white :target: https://discord.gg/RAKc3HF

Installation

The following commands are currently the valid ways of installing WaveLink.

WaveLink requires Python 3.7+

Windows

.. code:: sh

py -3.7 -m pip install Wavelink

Linux

.. code:: sh

python3.7 -m pip install Wavelink

Getting Started

A quick and easy bot example:

.. code:: py

import discord
import wavelink
from discord.ext import commands


class Bot(commands.Bot):

    def __init__(self):
        super(Bot, self).__init__(command_prefix=['audio ', 'wave ','aw '])

        self.add_cog(Music(self))

    async def on_ready(self):
        print(f'Logged in as {self.user.name} | {self.user.id}')


class Music(commands.Cog):

    def __init__(self, bot):
        self.bot = bot

        if not hasattr(bot, 'wavelink'):
            self.bot.wavelink = wavelink.Client(bot=self.bot)

        self.bot.loop.create_task(self.start_nodes())

    async def start_nodes(self):
        await self.bot.wait_until_ready()

        # Initiate our nodes. For this example we will use one server.
        # Region should be a discord.py guild.region e.g sydney or us_central (Though this is not technically required)
        await self.bot.wavelink.initiate_node(host='127.0.0.1',
                                              port=2333,
                                              rest_uri='http://127.0.0.1:2333',
                                              password='youshallnotpass',
                                              identifier='TEST',
                                              region='us_central')

    @commands.command(name='connect')
    async def connect_(self, ctx, *, channel: discord.VoiceChannel=None):
        if not channel:
            try:
                channel = ctx.author.voice.channel
            except AttributeError:
                raise discord.DiscordException('No channel to join. Please either specify a valid channel or join one.')

        player = self.bot.wavelink.get_player(ctx.guild.id)
        await ctx.send(f'Connecting to **`{channel.name}`**')
        await player.connect(channel.id)

    @commands.command()
    async def play(self, ctx, *, query: str):
        tracks = await self.bot.wavelink.get_tracks(f'ytsearch:{query}')

        if not tracks:
            return await ctx.send('Could not find any songs with that query.')

        player = self.bot.wavelink.get_player(ctx.guild.id)
        if not player.is_connected:
            await ctx.invoke(self.connect_)

        await ctx.send(f'Added {str(tracks[0])} to the queue.')
        await player.play(tracks[0])


bot = Bot()
bot.run('TOKEN')
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].