{"id":20822983,"url":"https://github.com/cog-creators/red-lavalink","last_synced_at":"2025-03-03T18:21:13.709Z","repository":{"id":30403692,"uuid":"124801734","full_name":"Cog-Creators/Red-Lavalink","owner":"Cog-Creators","description":"Lavalink client library used in Red-DiscordBot","archived":false,"fork":false,"pushed_at":"2024-09-04T16:43:01.000Z","size":299,"stargazers_count":26,"open_issues_count":2,"forks_count":23,"subscribers_count":11,"default_branch":"develop","last_synced_at":"2025-02-24T17:10:05.588Z","etag":null,"topics":["discord-py","lavalink","python3","red-discordbot"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Cog-Creators.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"patreon":"Red_Devs"}},"created_at":"2018-03-11T21:36:13.000Z","updated_at":"2024-09-04T16:42:57.000Z","dependencies_parsed_at":"2024-06-19T00:07:21.420Z","dependency_job_id":"77a0a3e6-bf5a-4e42-af06-f12f3140890d","html_url":"https://github.com/Cog-Creators/Red-Lavalink","commit_stats":{"total_commits":169,"total_committers":17,"mean_commits":9.941176470588236,"dds":0.7633136094674556,"last_synced_commit":"706619322daff73ed85d20dd804cdd761e59ff7c"},"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cog-Creators%2FRed-Lavalink","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cog-Creators%2FRed-Lavalink/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cog-Creators%2FRed-Lavalink/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cog-Creators%2FRed-Lavalink/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Cog-Creators","download_url":"https://codeload.github.com/Cog-Creators/Red-Lavalink/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241715022,"owners_count":20007914,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["discord-py","lavalink","python3","red-discordbot"],"created_at":"2024-11-17T22:16:49.252Z","updated_at":"2025-03-03T18:21:13.679Z","avatar_url":"https://github.com/Cog-Creators.png","language":"Python","funding_links":["https://patreon.com/Red_Devs"],"categories":[],"sub_categories":[],"readme":"============\nRed-Lavalink\n============\n\n.. image:: https://readthedocs.org/projects/red-lavalink/badge/?version=latest\n    :target: http://red-lavalink.readthedocs.io/en/latest/?badge=latest\n    :alt: Documentation Status\n\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg\n    :target: https://github.com/ambv/black\n    :alt: Code style: black\n\nA Lavalink client library written for Python 3.8 using the AsyncIO framework.\nThis library may be used for other projects as it contains no Red specific code or logic.\n\nHowever, it is important to note that this library only supports projects using discord.py.\n\nTo install::\n\n    pip install red-lavalink\n\n*****\nUsage\n*****\n\n.. code-block:: python\n\n    import lavalink\n    from discord.ext.commands import Bot\n\n\n    class MyBot(Bot):\n        async def setup_hook(self):\n            await lavalink.initialize(\n                self, host='localhost', password='password', port=2333\n            )\n\n\n    async def search_and_play(voice_channel, search_terms):\n        player = await lavalink.connect(voice_channel)\n        tracks = await player.search_yt(search_terms)\n        player.add(tracks[0])\n        await player.play()\n\n*********\nShuffling\n*********\n.. code-block:: python\n\n    def shuffle_queue(player_id, forced=True):\n        player = lavalink.get_player(player_id)\n        if not forced:\n            player.maybe_shuffle(sticky_songs=0)\n            \"\"\"\n            `player.maybe_shuffle` respects `player.shuffle`\n            And will only shuffle if `player.shuffle` is True.\n\n            `player.maybe_shuffle` should be called every time\n            you would expect the queue to be shuffled.\n\n            `sticky_songs=0` will shuffle every song in the queue.\n            \"\"\"\n        else:\n            player.force_shuffle(sticky_songs=3)\n            \"\"\"\n            `player.force_shuffle` does not respect `player.shuffle`\n            And will always shuffle the queue.\n\n            `sticky_songs=3` will shuffle every song after the first 3 songs in the queue.\n            \"\"\"\n\n\n\n\nWhen shutting down, be sure to do the following::\n\n    await lavalink.close(bot)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcog-creators%2Fred-lavalink","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcog-creators%2Fred-lavalink","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcog-creators%2Fred-lavalink/lists"}