Connector
Abstract class for creating custom bridges between Moonlink.js and Discord libraries.
The Connector class handles the communication layer between Moonlink.js and your Discord library. It manages the flow of voice packets and initializes the manager when the client is ready.
Properties
Connector Properties
Internal state of the connector.
References
The Manager instance attached to this connector.
Methods
setManager(manager)
Assigns the Moonlink Manager instance to the connector. This is called automatically by manager.use().
The Moonlink Manager instance.
listen(client)
Abstract. Attaches event listeners to the Discord client. This method should handle the 'ready' event (to call manager.init) and raw packet events (to call manager.packetUpdate).
The Discord library client instance.
send(guildId, payload)
Abstract. Transmits a voice packet payload to the Discord Gateway for a specific guild.
The ID of the guild.
The JSON payload to send.
Built-in: DiscordJs
new Connectors.DiscordJs()
The official implementation for the discord.js library.