{"id":22310381,"url":"https://github.com/lavacord/Lavacord","last_synced_at":"2025-07-29T07:33:01.233Z","repository":{"id":40725663,"uuid":"144360494","full_name":"lavacord/Lavacord","owner":"lavacord","description":"Lightweight Lavalink client for Node.js with TypeScript, ESM/CommonJS support and multiple Discord library compatibility","archived":false,"fork":false,"pushed_at":"2025-07-01T05:50:45.000Z","size":3569,"stargazers_count":84,"open_issues_count":1,"forks_count":22,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-01T06:32:29.667Z","etag":null,"topics":["bot","client","discord","discordjs","eris","lavalink","lavalink-client","lavalink-music","music","voice"],"latest_commit_sha":null,"homepage":"https://lavacord.js.org/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lavacord.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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,"zenodo":null},"funding":{"github":["AmandaDiscord","MrJacz"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"custom":null}},"created_at":"2018-08-11T06:13:05.000Z","updated_at":"2025-06-27T08:11:50.000Z","dependencies_parsed_at":"2025-01-08T11:02:29.273Z","dependency_job_id":"67e1ebc8-a992-4203-84a3-a34a0597d333","html_url":"https://github.com/lavacord/Lavacord","commit_stats":{"total_commits":99,"total_committers":12,"mean_commits":8.25,"dds":0.5858585858585859,"last_synced_commit":"55f315d39b5e39ec0c8a852768eabfd64434549e"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lavacord/Lavacord","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lavacord%2FLavacord","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lavacord%2FLavacord/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lavacord%2FLavacord/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lavacord%2FLavacord/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lavacord","download_url":"https://codeload.github.com/lavacord/Lavacord/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lavacord%2FLavacord/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267646069,"owners_count":24120934,"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","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["bot","client","discord","discordjs","eris","lavalink","lavalink-client","lavalink-music","music","voice"],"created_at":"2024-12-03T21:01:22.302Z","updated_at":"2025-07-29T07:33:01.223Z","avatar_url":"https://github.com/lavacord.png","language":"TypeScript","funding_links":["https://github.com/sponsors/AmandaDiscord","https://github.com/sponsors/MrJacz"],"categories":["TypeScript"],"sub_categories":[],"readme":"[![Discord](https://discordapp.com/api/guilds/323779330033319941/embed.png)](https://discord.gg/wXrjZmV)\n[![npm (scoped)](https://img.shields.io/npm/v/lavacord?label=npm%20version)](https://www.npmjs.com/package/lavacord)\n[![npm downloads](https://img.shields.io/npm/dt/lavacord.svg?label=total%20downloads)](https://www.npmjs.com/package/lavacord)\n[![GitHub](https://img.shields.io/github/license/lavacord/lavacord)](https://github.com/lavacord/lavacord/)\n[![Depfu](https://badges.depfu.com/badges/70051aad57dddc0c44a990d26b1f6e23/overview.svg)](https://depfu.com/github/lavacord/Lavacord?project_id=11810)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/b50839d781c24a94a4e1c17342a147bd)](https://www.codacy.com/app/lavacord/lavacord)\n\n# LavaCord\nA simple and easy to use lavalink wrapper.\n\n## Documentation\n[**lavacord.github.io/lavacord**](https://lavacord.github.io/Lavacord/)\n\n## Installation\n\n**For stable**\n```bash\n# Using yarn\nyarn add lavacord\n\n# Using npm\nnpm install lavacord\n```\n\n**For Development**\n```bash\n# Using yarn\nyarn add lavacord/lavacord\n\n# Using npm\nnpm install lavacord/lavacord\n```\n\n## LavaLink configuration\nDownload Lavalink from [their GitHub releases](https://github.com/lavalink-devs/Lavalink/releases)\n\nPut an `application.yml` file in your working directory. [Example](https://github.com/lavalink-devs/Lavalink/blob/master/LavalinkServer/application.yml.example)\n\nRun with `java -jar Lavalink.jar`\n\n## The issue tracker is for issues only\nIf you're having a problem with the module contact us in the [**Discord Server**](https://discord.gg/wXrjZmV)\n\n# Implementation\nStart by creating a new `Manager` passing an array of nodes and an object with `user` the client's user id.\n\n```javascript\n// import the Manager class from lavacord\nconst { Manager } = require(\"lavacord\");\n\n// Define the nodes array as an example\nconst nodes = [\n    { id: \"1\", host: \"localhost\", port: 2333, password: \"youshallnotpass\" }\n];\n\n// Initilize the Manager with all the data it needs\nconst manager = new Manager(nodes, {\n    user: client.user.id, // Client id\n    send: (packet) =\u003e {\n        // this needs to send the provided packet to discord's WS using the method from your library.\n        // use the bindings for the discord library you use if you don't understand this\n    }\n});\n\n// Connects all the LavalinkNode WebSockets\nawait manager.connect();\n\n// The error event, which you should handle otherwise your application will crash when an error is emitted\nmanager.on(\"error\", (error, node) =\u003e {\n    error, // is the error\n    node // is the node which the error is from\n});\n```\n\nResolving tracks using LavaLink REST API\n\n```javascript\nconst { Rest } = require(\"lavacord\");\n\nasync function getSongs(search) {\n    // This gets the best node available, what I mean by that is the idealNodes getter will filter all the connected nodes and then sort them from best to least beast.\n    const node = manager.idealNodes[0];\n\n    return Rest.load(node, search)\n        .catch(err =\u003e {\n            console.error(err);\n            return null;\n        });\n}\n\ngetSongs(\"ytsearch:30 second song\").then(songs =\u003e {\n    // handle loading of the tracks somehow ¯\\_(ツ)_/¯\n});\n```\n\nJoining and Leaving channels\n\n```javascript\n// Join\nconst player = await manager.join({\n    guild: guildId, // Guild id\n    channel: channelId, // Channel id\n    node: \"1\" // lavalink node id, based on array of nodes\n});\n\nawait player.play(track); // Track is a base64 string we get from Lavalink REST API\n\nplayer.once(\"error\", error =\u003e console.error(error));\nplayer.once(\"end\", data =\u003e {\n    if (data.type === \"TrackEndEvent\" \u0026\u0026 data.reason === \"replaced\") return; // Ignore replaced reason to prevent skip loops\n    // Play next song\n});\n\n// Leave voice channel and destroy Player\nawait manager.leave(guildId); // Player ID aka guild id\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flavacord%2FLavacord","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flavacord%2FLavacord","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flavacord%2FLavacord/lists"}