Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

harmonylink

Package Overview
Dependencies
Maintainers
0
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

harmonylink - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

3

dist/constants/player.d.ts
import { ConnectionOptions } from "../typings/player/connection";
export declare function getDefaultConnectionOptions(): ConnectionOptions;
import { PlayerOptions } from "../typings/player";
export declare function getDefaultConnectionOptions(options: PlayerOptions): ConnectionOptions;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getDefaultConnectionOptions = void 0;
function getDefaultConnectionOptions() {
function getDefaultConnectionOptions(options) {
return {

@@ -12,4 +12,4 @@ voiceRegion: null,

},
selfDeaf: false,
selfMute: false,
selfDeaf: options.deaf ?? false,
selfMute: options.mute ?? false,
};

@@ -16,0 +16,0 @@ }

@@ -44,5 +44,3 @@ /// <reference types="node" />

*/
createPlayer(playerOptions: Omit<PlayerOptions, "shardId"> & {
shardId?: string;
}, node?: Node): Promise<Player>;
createPlayer(playerOptions: Omit<PlayerOptions, "node">, node?: Node): Promise<Player>;
/**

@@ -49,0 +47,0 @@ * Destroys a player.

@@ -9,5 +9,3 @@ import { Player } from "../player/Player";

constructor(manager: HarmonyLink);
createPlayer(options: Omit<PlayerOptions, "shardId"> & {
shardId?: string;
}): Promise<Player>;
createPlayer(options: PlayerOptions): Promise<Player>;
removePlayer(guildId: string): Promise<Player | null>;

@@ -14,0 +12,0 @@ leastUsedNode(): Promise<Node>;

@@ -60,3 +60,3 @@ /// <reference types="node" />

*
* @docs https://lavalink.dev/api/rest.html#get-routeplanner-status
* @see https://lavalink.dev/api/rest.html#get-routeplanner-status
*/

@@ -68,3 +68,3 @@ getRoutePlannerStatus(): Promise<RoutePlannerStatus>;

*
* @docs https://lavalink.dev/api/rest.html#unmark-all-failed-address
* @see https://lavalink.dev/api/rest.html#unmark-all-failed-address
*/

@@ -77,5 +77,5 @@ unmarkAllFailingAddresses(): Promise<ErrorResponses | void>;

*
* @docs https://lavalink.dev/api/rest.html#unmark-a-failed-address
* @see https://lavalink.dev/api/rest.html#unmark-a-failed-address
*/
unmarkFailingAddress(address: string): Promise<ErrorResponses | void>;
}

@@ -120,3 +120,3 @@ "use strict";

*
* @docs https://lavalink.dev/api/rest.html#get-routeplanner-status
* @see https://lavalink.dev/api/rest.html#get-routeplanner-status
*/

@@ -131,3 +131,3 @@ async getRoutePlannerStatus() {

*
* @docs https://lavalink.dev/api/rest.html#unmark-all-failed-address
* @see https://lavalink.dev/api/rest.html#unmark-all-failed-address
*/

@@ -143,3 +143,3 @@ async unmarkAllFailingAddresses() {

*
* @docs https://lavalink.dev/api/rest.html#unmark-a-failed-address
* @see https://lavalink.dev/api/rest.html#unmark-a-failed-address
*/

@@ -146,0 +146,0 @@ async unmarkFailingAddress(address) {

import { ConnectionOptions, SetStateUpdate, VoiceServer } from "../typings/player/connection";
import { Player } from "./Player";
import { PlayerOptions } from "../typings/player";
export declare class ConnectionHandler {
readonly player: Player;
options: ConnectionOptions;
constructor(player: Player);
constructor(player: Player, options: PlayerOptions);
/**

@@ -8,0 +9,0 @@ * Updates the voice server of the player.

@@ -10,5 +10,5 @@ "use strict";

options;
constructor(player) {
constructor(player, options) {
this.player = player;
this.options = (0, player_1.getDefaultConnectionOptions)();
this.options = (0, player_1.getDefaultConnectionOptions)(options);
}

@@ -21,3 +21,2 @@ ;

async setServersUpdate(data) {
console.log(data);
if (!data.endpoint) {

@@ -24,0 +23,0 @@ this.player.emit('connectionUpdate', connection_1.DiscordVoiceStates.SESSION_ENDPOINT_MISSING);

@@ -41,7 +41,6 @@ /// <reference types="node" />

position: number;
constructor(manager: HarmonyLink, node: Node, options: Omit<PlayerOptions, "shardId"> & {
shardId?: string;
});
constructor(manager: HarmonyLink, node: Node, options: PlayerOptions);
/**
* Connects the player to the voice channel.
*
* @returns {Promise<Player>} - A Promise that resolves to the Player instance.

@@ -126,2 +125,14 @@ */

autoplay(previousTrack?: Track | null): Promise<Player>;
/**
* Sets the mute state for the player.
* @param {boolean} mute - Whether to mute or unmute the player in the voice channel.
* @returns {Promise<Player>} - A Promise that resolves to the Player instance.
*/
setMute(mute: boolean): Promise<Player>;
/**
* Sets the deaf state for the player.
* @param {boolean} deaf - Whether to deafen or undeafen the player in the voice channel.
* @returns {Promise<Player>} - A Promise that resolves to the Player instance.
*/
setDeaf(deaf: boolean): Promise<Player>;
protected disconnect(cleanQueue?: boolean): Promise<Player>;

@@ -128,0 +139,0 @@ protected checkDestroyed(): void;

@@ -59,3 +59,3 @@ "use strict";

// Handlers
this.ConnectionHandler = new Connection_1.ConnectionHandler(this);
this.ConnectionHandler = new Connection_1.ConnectionHandler(this, options);
this.queue = new Queue_1.Queue();

@@ -78,2 +78,3 @@ this.filters = new Filters_1.Filters(this);

* Connects the player to the voice channel.
*
* @returns {Promise<Player>} - A Promise that resolves to the Player instance.

@@ -415,2 +416,29 @@ */

}
;
/**
* Sets the mute state for the player.
* @param {boolean} mute - Whether to mute or unmute the player in the voice channel.
* @returns {Promise<Player>} - A Promise that resolves to the Player instance.
*/
async setMute(mute) {
return new Promise((resolve) => {
this.ConnectionHandler.options.selfMute = mute;
this.sendVoiceUpdate();
return resolve(this);
});
}
;
/**
* Sets the deaf state for the player.
* @param {boolean} deaf - Whether to deafen or undeafen the player in the voice channel.
* @returns {Promise<Player>} - A Promise that resolves to the Player instance.
*/
async setDeaf(deaf) {
return new Promise((resolve) => {
this.ConnectionHandler.options.selfDeaf = deaf;
this.sendVoiceUpdate();
return resolve(this);
});
}
;
async disconnect(cleanQueue = false) {

@@ -417,0 +445,0 @@ if (!this.voiceChannelId || this.voiceState === player_1.VoiceConnectionState.DISCONNECTED)

@@ -48,4 +48,4 @@ import AbstractLibraryClass from "../librarys/AbstractLibraryClass";

*
* @note If you are using a custom driver, you should extend `AbstractNodeDriver` and implement the methods.
* @note If you want, you can go onto our github and create a pull request to add your driver to the main repository so that it is supported by default.
* @see If you are using a custom driver, you should extend `AbstractNodeDriver` and implement the methods.
* @see If you want, you can go onto our github and create a pull request to add your driver to the main repository so that it is supported by default.
*

@@ -52,0 +52,0 @@ * @default []

@@ -96,3 +96,3 @@ import { PlayerState } from "../player";

* This interface represents the LavaLink V4 Error Responses
* @reference https://lavalink.dev/api/rest.html#error-responses
* @see https://lavalink.dev/api/rest.html#error-responses
*/

@@ -99,0 +99,0 @@ export interface ErrorResponses {

@@ -41,12 +41,32 @@ import { Node } from "../../node/Node";

export interface PlayerOptions {
/**
* The guild id to create the player for
*/
guildId: string;
/**
* The voice channel id to connect to
*/
voiceId: string;
/**
* The text channel id to send messages to
*/
textId: string;
shardId: string;
mute: boolean;
deaf: boolean;
/**
* The shard id this player's guild is on
* @optional
*/
shardId?: string;
/**
* If the player should be muted
* @optional
*/
mute?: boolean;
/**
* If the player should be deafened
* @optional
*/
deaf?: boolean;
/**
* The node to connect to
* @optional
*
*/

@@ -53,0 +73,0 @@ node?: Node;

/**
* The response of the player API
*
* @docs https://lavalink.dev/api/rest#playlist-info
* @see https://lavalink.dev/api/rest#playlist-info
*/

@@ -6,0 +6,0 @@ export interface PlaylistInfoFound {

{
"name": "harmonylink",
"version": "1.1.1",
"version": "1.1.2",
"description": "HarmonyLink: Seamlessly connect to LavaLink nodes for high-quality audio streaming in your applications. HarmonyLink offers a reliable and easy-to-use interface, perfect for building music bots and audio applications with superior performance.",

@@ -5,0 +5,0 @@ "main": "./dist/index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc