pycord.wavelink


Namepycord.wavelink JSON
Version 1.0.0b56 PyPI version JSON
download
home_pagehttps://github.com/Pycord-Development/Pycord.Wavelink
SummaryA robust and powerful Lavalink wrapper for pycord.
upload_time2023-01-12 21:03:07
maintainer
docs_urlNone
authorPycord Development
requires_python
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Pycord.Wavelink
===============

.. image:: https://img.shields.io/badge/Python-3.7%20%7C%203.8%20%7C%203.9-blue.svg
    :target: https://www.python.org
    :align: center
.. image:: https://img.shields.io/pypi/v/pycord.wavelink.svg
    :target: https://pypi.org/project/pycord.wavelink/
    :align: center

Wavelink is robust and powerful Lavalink wrapper for `Pycord <https://github.com/Pycord-Development/pycord>`_!
Wavelink features a fully asynchronous API that's intuitive and easy to use.

Support
---------------------------
For support using Pycord.WaveLink, please join the official `support server
<https://discord.gg/pycord>`_ on `Discord <https://discord.com/>`_.

|Discord|

.. |Discord| image:: https://discord.com/api/guilds/881207955029110855/embed.png?style=banner2
   :target: https://discord.gg/pycord

Documentation
---------------------------

The documention can be found `here <https://wavelink-docs.pycord.dev/en/latest/>`_!

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

**WaveLink requires Python 3.8+**

**Windows**

.. code:: sh

    py -3.9 -m pip install pycord.wavelink --pre

**Linux**

.. code:: sh

    python3.9 -m pip install pycord.wavelink --pre

Getting Started
----------------------------

A quick and easy bot example:

.. code:: py
    
    import pycord.wavelink as wavelink
    from discord.ext import commands

    class Bot(commands.Bot):
        def __init__(self):
            super().__init__(command_prefix='>?')

        async def on_ready(self):
            print('Bot is ready!')

    class Music(commands.Cog):
        """Music cog to hold Wavelink related commands and listeners."""
        def __init__(self, bot: commands.Bot):
            self.bot = bot
            bot.loop.create_task(self.connect_nodes())

        async def connect_nodes(self):
            """Connect to our Lavalink nodes."""
            await self.bot.wait_until_ready()
            await wavelink.NodePool.create_node(
                bot=bot,
                host='0.0.0.0',
                port=2333,
                password='YOUR_LAVALINK_PASSWORD',
            )

        @commands.Cog.listener()
        async def on_wavelink_node_ready(self, node: wavelink.Node):
            """Event fired when a node has finished connecting."""
            print(f'Node: <{node.identifier}> is ready!')

        @commands.command()
        async def play(self, ctx: commands.Context, *, search: wavelink.YouTubeTrack):
            """Play a song with the given search query.
            If not connected, connect to our voice channel.
            """
            if not ctx.voice_client:
                vc: wavelink.Player = await ctx.author.voice.channel.connect(cls=wavelink.Player)
            else:
                vc: wavelink.Player = ctx.voice_client
            await vc.play(search)

    bot = Bot()
    bot.add_cog(Music(bot))
    bot.run('YOUR_BOT_TOKEN')



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Pycord-Development/Pycord.Wavelink",
    "name": "pycord.wavelink",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Pycord Development",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/79/65/3b2faffa4ad43bf73fb3d41d6c2ab4e450a0b8eb0d409b7e49ff27ee0384/pycord.wavelink-1.0.0b56.tar.gz",
    "platform": null,
    "description": "Pycord.Wavelink\n===============\n\n.. image:: https://img.shields.io/badge/Python-3.7%20%7C%203.8%20%7C%203.9-blue.svg\n    :target: https://www.python.org\n    :align: center\n.. image:: https://img.shields.io/pypi/v/pycord.wavelink.svg\n    :target: https://pypi.org/project/pycord.wavelink/\n    :align: center\n\nWavelink is robust and powerful Lavalink wrapper for `Pycord <https://github.com/Pycord-Development/pycord>`_!\nWavelink features a fully asynchronous API that's intuitive and easy to use.\n\nSupport\n---------------------------\nFor support using Pycord.WaveLink, please join the official `support server\n<https://discord.gg/pycord>`_ on `Discord <https://discord.com/>`_.\n\n|Discord|\n\n.. |Discord| image:: https://discord.com/api/guilds/881207955029110855/embed.png?style=banner2\n   :target: https://discord.gg/pycord\n\nDocumentation\n---------------------------\n\nThe documention can be found `here <https://wavelink-docs.pycord.dev/en/latest/>`_!\n\nInstallation\n---------------------------\nThe following commands are currently the valid ways of installing WaveLink.\n\n**WaveLink requires Python 3.8+**\n\n**Windows**\n\n.. code:: sh\n\n    py -3.9 -m pip install pycord.wavelink --pre\n\n**Linux**\n\n.. code:: sh\n\n    python3.9 -m pip install pycord.wavelink --pre\n\nGetting Started\n----------------------------\n\nA quick and easy bot example:\n\n.. code:: py\n    \n    import pycord.wavelink as wavelink\n    from discord.ext import commands\n\n    class Bot(commands.Bot):\n        def __init__(self):\n            super().__init__(command_prefix='>?')\n\n        async def on_ready(self):\n            print('Bot is ready!')\n\n    class Music(commands.Cog):\n        \"\"\"Music cog to hold Wavelink related commands and listeners.\"\"\"\n        def __init__(self, bot: commands.Bot):\n            self.bot = bot\n            bot.loop.create_task(self.connect_nodes())\n\n        async def connect_nodes(self):\n            \"\"\"Connect to our Lavalink nodes.\"\"\"\n            await self.bot.wait_until_ready()\n            await wavelink.NodePool.create_node(\n                bot=bot,\n                host='0.0.0.0',\n                port=2333,\n                password='YOUR_LAVALINK_PASSWORD',\n            )\n\n        @commands.Cog.listener()\n        async def on_wavelink_node_ready(self, node: wavelink.Node):\n            \"\"\"Event fired when a node has finished connecting.\"\"\"\n            print(f'Node: <{node.identifier}> is ready!')\n\n        @commands.command()\n        async def play(self, ctx: commands.Context, *, search: wavelink.YouTubeTrack):\n            \"\"\"Play a song with the given search query.\n            If not connected, connect to our voice channel.\n            \"\"\"\n            if not ctx.voice_client:\n                vc: wavelink.Player = await ctx.author.voice.channel.connect(cls=wavelink.Player)\n            else:\n                vc: wavelink.Player = ctx.voice_client\n            await vc.play(search)\n\n    bot = Bot()\n    bot.add_cog(Music(bot))\n    bot.run('YOUR_BOT_TOKEN')\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A robust and powerful Lavalink wrapper for pycord.",
    "version": "1.0.0b56",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cab2e84057e2096a5c63c31f953e4442059a4f76e1ae3fe3189d0526c8b0c964",
                "md5": "60d82287fd1e5ba77e4d01a0bbdc597e",
                "sha256": "bda4bd797c955d7250f802dbff5f8487abd41ef68e61810c17e68b4e40f4469b"
            },
            "downloads": -1,
            "filename": "pycord.wavelink-1.0.0b56-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "60d82287fd1e5ba77e4d01a0bbdc597e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 34371,
            "upload_time": "2023-01-12T21:03:05",
            "upload_time_iso_8601": "2023-01-12T21:03:05.641524Z",
            "url": "https://files.pythonhosted.org/packages/ca/b2/e84057e2096a5c63c31f953e4442059a4f76e1ae3fe3189d0526c8b0c964/pycord.wavelink-1.0.0b56-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "79653b2faffa4ad43bf73fb3d41d6c2ab4e450a0b8eb0d409b7e49ff27ee0384",
                "md5": "164467e5e3b84c100057aefcf1c164bd",
                "sha256": "3ff36a22456f5e905f1d5dbe833eadaad318c39ffc163b93b14609c8988ddc60"
            },
            "downloads": -1,
            "filename": "pycord.wavelink-1.0.0b56.tar.gz",
            "has_sig": false,
            "md5_digest": "164467e5e3b84c100057aefcf1c164bd",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 23082,
            "upload_time": "2023-01-12T21:03:07",
            "upload_time_iso_8601": "2023-01-12T21:03:07.388021Z",
            "url": "https://files.pythonhosted.org/packages/79/65/3b2faffa4ad43bf73fb3d41d6c2ab4e450a0b8eb0d409b7e49ff27ee0384/pycord.wavelink-1.0.0b56.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-12 21:03:07",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "Pycord-Development",
    "github_project": "Pycord.Wavelink",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "pycord.wavelink"
}
        
Elapsed time: 0.05055s