This repository has been archived by the owner on Apr 3, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
12 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,10 @@ | ||
import { BaseNode, BaseNodeOptions, NodeSend } from './base/BaseNode'; | ||
|
||
/** | ||
* The options for the node. | ||
*/ | ||
export interface NodeOptions extends BaseNodeOptions { | ||
/** | ||
* The send method, this is used by Lavalink to send gateway events to Discord. | ||
* @note You are responsible for properly serializing and encoding the packet for transmission. | ||
* @example | ||
* ```typescript | ||
* // Example for discord.js | ||
* (guildID, packet) => { | ||
* const guild = client.guilds.cache.get(guildID); | ||
* if (guild) return guild.shard.send(packet); | ||
* }; | ||
* ``` | ||
*/ | ||
send: NodeSend; | ||
} | ||
import { BaseNode, NodeOptions, NodeSend } from './base/BaseNode'; | ||
|
||
export class Node extends BaseNode { | ||
public send: NodeSend; | ||
|
||
public constructor(options: NodeOptions) { | ||
public constructor(options: NodeOptions, send: NodeSend) { | ||
super(options); | ||
this.send = options.send; | ||
this.send = send; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters