Socket
Socket
Sign inDemoInstall

shoukaku

Package Overview
Dependencies
Maintainers
1
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

shoukaku - npm Package Compare versions

Comparing version 2.0.4 to 2.1.0

types/enums.d.ts

46

index.d.ts

@@ -1,29 +0,21 @@

import { Shoukaku } from './types/Shoukaku';
import { Utils } from './types/Utils';
import { ShoukakuConnection } from './types/guild/ShoukakuConnection';
import { ShoukakuPlayer } from './types/guild/ShoukakuPlayer';
import { ShoukakuRest } from './types/node/ShoukakuRest';
import { ShoukakuSocket } from './types/node/ShoukakuSocket';
import { ShoukakuFilter } from './types/struct/ShoukakuFilter';
import { ShoukakuStats } from './types/struct/ShoukakuStats';
import { version } from './package.json';
import * as Constants from './types/enums';
import * as Libraries from './types/libraries';
import { Shoukaku, ShoukakuConnection, ShoukakuFilter, ShoukakuPlayer, ShoukakuRest, ShoukakuSocket, ShoukakuStats, ShoukakuTrack, ShoukakuTrackList, Utils } from "./types";
import * as Constants from './types/Constants';
import * as Libraries from './types/libraries/Libraries';
export {
Shoukaku,
Utils,
ShoukakuConnection,
ShoukakuPlayer,
ShoukakuRest,
ShoukakuSocket,
ShoukakuFilter,
ShoukakuStats,
ShoukakuTrack,
ShoukakuTrackList,
Constants,
Libraries,
version
};
import { version } from './package.json'
declare module 'shoukaku' {
export {
Shoukaku,
Utils,
ShoukakuConnection,
ShoukakuPlayer,
ShoukakuRest,
ShoukakuSocket,
ShoukakuFilter,
ShoukakuStats,
Constants,
Libraries,
version
};
}
{
"name": "shoukaku",
"version": "2.0.4",
"version": "2.1.0",
"description": "A lavalink wrapper that supports almost all libraries",
"main": "index.js",
"types": "index.d.ts",
"scripts": {

@@ -10,3 +11,2 @@ "docs:build": "docma build",

},
"types": "index.d.ts",
"keywords": [

@@ -35,4 +35,4 @@ "bot",

"abort-controller": "^3.0.0",
"petitio": "^1.3.2",
"ws": "^8.2.0"
"petitio": "^1.4.0",
"ws": "^8.2.3"
},

@@ -42,2 +42,2 @@ "devDependencies": {

}
}
}

@@ -30,2 +30,12 @@ const { name, version, repository } = require('../package.json');

/**
* Lavaplayer Search Prefix
* @enum {string}
* @memberof Constants
*/
SearchTypes: {
soundcloud: 'scsearch',
youtube: 'ytsearch',
youtubemusic: 'ytmsearch'
},
/**
* Options that Shoukaku accepts upon initialization

@@ -32,0 +42,0 @@ * @property {boolean} [resumable=false] If you want your node to support resuming

@@ -66,3 +66,3 @@ const AbortController = require('abort-controller');

* The state of this connection
* @type {Constants.state}
* @type {state}
*/

@@ -69,0 +69,0 @@ this.state = state.DISCONNECTED;

@@ -6,3 +6,2 @@ const Petitio = require('petitio');

const Success = ['TRACK_LOADED', 'PLAYLIST_LOADED', 'SEARCH_RESULT'];
/**

@@ -46,3 +45,3 @@ * ShoukakuRest, provides access to Lavalink REST API

* @memberof ShoukakuRest
* @returns {Promise<void|ShoukakuTrackList>}
* @returns {Promise<ShoukakuTrackList>}
*/

@@ -53,3 +52,2 @@ async resolve(identifier, search = null) {

const data = await this.router.loadtracks({ identifier }).get();
if (!Success.includes(data.loadType)) return;
return new ShoukakuTrackList(data);

@@ -56,0 +54,0 @@ }

@@ -49,3 +49,3 @@ const EventEmitter = require('events');

* The state of this socket
* @type {Constants.state}
* @type {state}
*/

@@ -207,3 +207,3 @@ this.state = state.DISCONNECTED;

*/
async joinChannel(options = { }) {
async joinChannel(options = {}) {
if (isNaN(options.shardId) || !options.guildId || !options.channelId)

@@ -210,0 +210,0 @@ throw new Error('Supplied options needs to have a "guildId", "shardId", and "channelId" properties');

@@ -13,3 +13,3 @@ const ShoukakuTrack = require('./ShoukakuTrack.js');

/**
* Type of this list, can be PLAYLIST, TRACK or SEARCH. PLAYLIST and SEARCH can contain more than one tracks in tracks array while TRACK will contain a single track in the tracks array
* Type of ShoukakuTrackList, can be PLAYLIST, TRACK, SEARCH, NO_MATCHES or LOAD_FAILED.
* @type {string}

@@ -16,0 +16,0 @@ */

# Make your own Library Implementation Typings
Should follow this structire. Replace `<ClientClass>` with your client of choice's client class, replace `<DiscordLib>` with your client of choice's name, replace `<MapLike>` with your client of choice's way of storing guilds' interface (this must be a `Map`, or a interface that extends a `Map`), replace `<MapKey>` and `<MapValue>` with the key type and value type of your client of choice's guild `<MapLike>`. Your typings file should also be named `<DiscordLib>.d.ts` and be placed inside the wrappers folder. You should also edit the `Libraries.d.ts` and add your Library Implementation Typings class to the `Libraries` interface.
Should follow this structure. Replace `<DiscordLib>` with your client of choice's name. Your typings file should also be named `<DiscordLib>.d.ts` and be placed inside the libraries folder. You should also edit the `index.d.ts` in libraries folder and export your Library Implementation Typings.
```ts
import { <ClientClass> as DiscordClient } from '<DiscordLib>';
import { Shoukaku } from '../Shoukaku';
import { NodeOptions } from '../Constants';
import { GetterObj } from './Constants';
import { GetterObj, NodeOptions, Shoukaku } from "..";
export class <DiscordLib> {
constructor(
client: <ClientClass>
client: unknown
);
public getters(): GetterObj<<MapKey>, <MapValue>, <MapLike<<Mapkey>, <MapValue>>>>;
public build(shoukaku: Shoukaku, nodes: NodeOptions): GetterObj;
public client: unknown;
public getters(): GetterObj;
public build(shoukaku: Shoukaku, nodes: NodeOptions[]): GetterObj;
}
```
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