Skip to content

Commit

Permalink
Update 1.configuring.md
Browse files Browse the repository at this point in the history
Signed-off-by: Lucas Morais Rodrigues <[email protected]>
  • Loading branch information
1Lucas1apk authored Feb 12, 2024
1 parent 515faf2 commit 29db99d
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions docs/content/1.introduction/1.configuring.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
---
title: how moonlink.js works
---

Expand Down Expand Up @@ -80,10 +79,20 @@ Removing a node from the system is straightforward using the `remove` method:
<moonlink>.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
<moonlink>.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
<client>.on("raw", (data) => <moonlink>.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.

0 comments on commit 29db99d

Please sign in to comment.