From 29db99dc74302f468c1d4d088adacb69ae02035e Mon Sep 17 00:00:00 2001 From: Lucas Morais Rodrigues <76886832+1Lucas1apk@users.noreply.github.com> Date: Mon, 12 Feb 2024 17:53:43 -0400 Subject: [PATCH] Update 1.configuring.md Signed-off-by: Lucas Morais Rodrigues <76886832+1Lucas1apk@users.noreply.github.com> --- docs/content/1.introduction/1.configuring.md | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/docs/content/1.introduction/1.configuring.md b/docs/content/1.introduction/1.configuring.md index 793a94a3..3736a459 100644 --- a/docs/content/1.introduction/1.configuring.md +++ b/docs/content/1.introduction/1.configuring.md @@ -1,5 +1,4 @@ --- ---- title: how moonlink.js works --- @@ -80,10 +79,20 @@ Removing a node from the system is straightforward using the `remove` method: .nodes.remove("example.com") ``` -#### MoonlinkNode Class +#### Initialization and Packet Updates + +Before utilizing Moonlink, it's essential to initialize the package and handle packet updates. Initialization ensures proper synchronization with the client, while packet updates enable seamless integration with audio streaming servers. + +```js +.init(clientId) +``` + +To handle packet updates, listen for raw data events from the client and pass them to Moonlink: -Upon adding or retrieving a node, Moonlink returns an instance of the `MoonlinkNode` class. This class provides functionalities specific to node management, allowing for efficient stream handling and workload distribution. +```js +.on("raw", (data) => .packetUpdate(data)) +``` -## Conclusion +### Understanding Lavalink -By leveraging Moonlink's modular structure and intuitive API, developers can enhance their applications with robust audio playback capabilities. Whether managing players, nodes, or controlling playback within specific contexts, Moonlink simplifies the process, allowing for seamless integration and enhanced user experiences. +Lavalink serves as a simplified audio playback server, functioning as both an API and a WebSocket server for manipulating audio streams. It interfaces with LavaPlayer, which manages audio sources and related functionalities. Additionally, it includes Koe, similar to `@discordjs/Voice`, facilitating connections with Discord for audio transmission.