跳至主要内容
版本:v1.1.1

@types

Table of contents

Enumerations

Interfaces

Type Aliases

Type Aliases

ChannelMixOptions

Ƭ ChannelMixOptions: Object

Type declaration

NameType
leftToLeft?number
leftToRight?number
rightToLeft?number
rightToRight?number

Defined in

@types/index.ts:388


DistortionOptions

Ƭ DistortionOptions: Object

Type declaration

NameType
cosOffset?number
cosScale?number
offset?number
scale?number
sinOffset?number
sinScale?number
tanOffset?number
tanScale?number

Defined in

@types/index.ts:395


EventListeners

Ƭ EventListeners<T>:

Type declaration

Eventlistener
debugmessage: string
rawnode: Node, payload: unknown
nodeConnectnode: Node
nodeResumenode: Node
nodeDisconnectnode: Node, code: number, reason: string
warnnode: Node, warn: string
errornode: Node, error: Error
trackStartplayer: Player, track: Track
trackEndplayer: Player, track: Track, reason: TrackEndReason
trackStuckplayer: Player, track: Track, thresholdMs: number
trackExceptionplayer: Player, track: default | Track, exception: LoadException & { cause: string }
playerCreateplayer: Player
playerDestroyplayer: Player
playerDisconnectplayer: Player, code: number, reason: string
queueEndplayer: Player
pongnode: Node, ping?: number

Type parameters

Name
T

Type declaration

▸ (event, listener): T

LavaShark events

Parameters
NameType
event"debug"
listener(message: string) => void
Returns

T

▸ (event, listener): T

LavaShark events

Parameters
NameType
event"raw"
listener(node: Node, payload: unknown) => void
Returns

T

▸ (event, listener): T

LavaShark events

Parameters
NameType
event"nodeConnect"
listener(node: Node) => void
Returns

T

▸ (event, listener): T

LavaShark events

Parameters
NameType
event"nodeResume"
listener(node: Node) => void
Returns

T

▸ (event, listener): T

LavaShark events

Parameters
NameType
event"nodeDisconnect"
listener(node: Node, code: number, reason: string) => void
Returns

T

▸ (event, listener): T

LavaShark events

Parameters
NameType
event"warn"
listener(node: Node, warn: string) => void
Returns

T

▸ (event, listener): T

LavaShark events

Parameters
NameType
event"error"
listener(node: Node, error: Error) => void
Returns

T

▸ (event, listener): T

LavaShark events

Parameters
NameType
event"trackStart"
listener(player: Player, track: Track) => void
Returns

T

▸ (event, listener): T

LavaShark events

Parameters
NameType
event"trackEnd"
listener(player: Player, track: Track, reason: TrackEndReason) => void
Returns

T

▸ (event, listener): T

LavaShark events

Parameters
NameType
event"trackStuck"
listener(player: Player, track: Track, thresholdMs: number) => void
Returns

T

▸ (event, listener): T

LavaShark events

Parameters
NameType
event"trackException"
listener(player: Player, track: default | Track, exception: LoadException & { cause: string }) => void
Returns

T

▸ (event, listener): T

LavaShark events

Parameters
NameType
event"playerCreate"
listener(player: Player) => void
Returns

T

▸ (event, listener): T

LavaShark events

Parameters
NameType
event"playerDestroy"
listener(player: Player) => void
Returns

T

▸ (event, listener): T

LavaShark events

Parameters
NameType
event"playerDisconnect"
listener(player: Player, code: number, reason: string) => void
Returns

T

▸ (event, listener): T

LavaShark events

Parameters
NameType
event"queueEnd"
listener(player: Player) => void
Returns

T

▸ (event, listener): T

LavaShark events

Parameters
NameType
event"pong"
listener(node: Node, ping?: number) => void
Returns

T

Defined in

@types/index.ts:75


FilterOptions

Ƭ FilterOptions: Object

Index signature

[key: string]: unknown

Type declaration

NameTypeDescription
channelMix?ChannelMixOptions-
distortion?DistortionOptions-
equalizer?number[]15 bands [0-14] 25 Hz, 40 Hz, 63 Hz, 100 Hz, 160 Hz, 250 Hz, 400 Hz, 630 Hz, 1 kHz, 1.6 kHz, 2.5 kHz, 4 kHz, 6.3 kHz, 10 kHz, 16 kHz
karaoke?KaraokeOptions-
lowPass?LowPassOptions-
rotation?RotationOptions-
timescale?TimescaleOptions-
tremolo?TremoloOptions-
vibrato?VibratoOptions-
volume?number-

Defined in

@types/index.ts:437


IncomingDiscordPayload

Ƭ IncomingDiscordPayload: Object

Type declaration

NameType
d?unknown
opnumber
s?number
t?string

Defined in

@types/index.ts:14


Info

Ƭ Info: Object

Lavalink Info

Type declaration

NameType
buildTimenumber
filtersstring[]
git{ branch: string ; commit: string ; commitTime: number }
git.branchstring
git.commitstring
git.commitTimenumber
jvmstring
lavaplayerstring
plugins{ name: string ; version: string }[]
sourceManagersstring[]
version{ major: number ; minor: number ; patch: number ; preRelease: string | null ; semver: string }
version.majornumber
version.minornumber
version.patchnumber
version.preReleasestring | null
version.semverstring

Defined in

@types/index.ts:260


KaraokeOptions

Ƭ KaraokeOptions: Object

Type declaration

NameType
filterBand?number
filterWidth?number
level?number
monoLevel?number

Defined in

@types/index.ts:406


LavaSharkOptions

Ƭ LavaSharkOptions: Object

Main constructor options

Type declaration

NameTypeDescription
defaultSearchSource?SEARCH_SOURCEThe default source to search for tracks
disabledSources?UNRESOLVED_SOURCES[]Disables spotify, apple music or deezer
nodesNodeOptions[]The array of lavalink nodes
sendWS(guildId: string, payload: OutgoingDiscordPayload) => voidFunction to send voice channel connect payloads to discord
spotify?SpotifyConfigThe spotify credentials
unresolvedSearchSource?SEARCH_SOURCEThe default source to search for unresolved tracks
useISRC?booleanWhether to search for ISRC to resolve tracks or not

Defined in

@types/index.ts:57


LavalinkRESTError

Ƭ LavalinkRESTError: Object

Type declaration

NameType
errorstring
messagestring
pathstring
statusnumber
timestampnumber
trace?string

Defined in

@types/index.ts:114


LoadTracksResult

Ƭ LoadTracksResult: LoadResultBase & { tracks: ITrack[] }

Defined in

@types/index.ts:168


LowPassOptions

Ƭ LowPassOptions: Object

Type declaration

NameType
smoothing?number

Defined in

@types/index.ts:413


Metadata

Ƭ Metadata: Pick<TrackInfo, "title" | "author" | "uri"> & { duration: Timestamp ; isrc?: string ; source: string }

Defined in

@types/index.ts:48


NodeOptions

Ƭ NodeOptions: Object

Lavalink node options

Type declaration

NameTypeDescription
followRedirects?booleanWhether to follow redirects or not (default is false)
hostnamestringThe node hostname
id?stringThe node identifier
maxRetryAttempts?numberThe max number of retry attempts
password?stringThe node password
portnumberThe node port
resumeKey?stringThe resume key
resumeTimeout?numberThe resume timeout, in seconds
retryAttemptsInterval?numberThe interval between retry attempts
secure?booleanWhether to use SSL/TLS or not

Defined in

@types/index.ts:184


NodeStats

Ƭ NodeStats: Object

Lavalink node stats

Type declaration

NameTypeDescription
cpu{ cores: number ; lavalinkLoad: number ; systemLoad: number }CPU stats, [0, 1]
cpu.coresnumber-
cpu.lavalinkLoadnumber-
cpu.systemLoadnumber-
frameStats?{ deficit: number ; nulled: number ; sent: number }Audio frame stats
frameStats.deficitnumber-
frameStats.nullednumber-
frameStats.sentnumber-
memory{ allocated: number ; free: number ; reservable: number ; used: number }RAM stats, in bytes
memory.allocatednumber-
memory.freenumber-
memory.reservablenumber-
memory.usednumber-
playersnumberThe total player amount
playingPlayersnumberThe amount of playing players
uptimenumberThe lavalink node uptime, in seconds

Defined in

@types/index.ts:208


OutgoingDiscordPayload

Ƭ OutgoingDiscordPayload: Object

Type declaration

NameType
dRecord<string, unknown>
opnumber

Defined in

@types/index.ts:9


PlayOptions

Ƭ PlayOptions: Object

Type declaration

NameType
endTime?number
noReplace?boolean
pause?boolean
startTime?number

Defined in

@types/index.ts:364


PlayerOptions

Ƭ PlayerOptions: Object

Main constructor options

Type declaration

NameTypeDescription
guildIdstringThe guild id that player belongs to
queue?QueueThe queue object that player will use
selfDeaf?booleanWhether the bot joins the voice channel deafened or not
selfMute?booleanWhether the bot joins the voice channel muted or not
textChannelId?stringThe text channel id
voiceChannelIdstringThe voice channel id

Defined in

@types/index.ts:344


PlayerState

Ƭ PlayerState: Object

Type declaration

NameTypeDescription
connectedbooleanWhether the player is connected to discord voice gateway
position?numberTrack position in ms
timenumberUnix timestamp when the position was picked

Defined in

@types/index.ts:329


PlaylistInfo

Ƭ PlaylistInfo: Object

Type declaration

NameType
durationnumber
namestring
selectedTracknumber

Defined in

@types/index.ts:130


RequestOptions

Ƭ RequestOptions: Object

Type declaration

NameType
headers?Record<string, string>
json?unknown
methodDispatcher.HttpMethod
pathstring

Defined in

@types/index.ts:123


RotationOptions

Ƭ RotationOptions: Object

Type declaration

NameType
rotationHz?number

Defined in

@types/index.ts:417


RoutePlannerStatus

Ƭ RoutePlannerStatus: Object

Route planner API

Type declaration

NameType
classstring | null
detailsRoutePlannerDetails | null

Defined in

@types/index.ts:237


SEARCH_SOURCE

Ƭ SEARCH_SOURCE: "youtube" | "youtubemusic" | "soundcloud"

Defined in

@types/index.ts:94


SearchResult

Ƭ SearchResult: LoadResultBase & { tracks: (Track | UnresolvedTrack)[] }

Defined in

@types/index.ts:172


TimescaleOptions

Ƭ TimescaleOptions: Object

Type declaration

NameType
pitch?number
rate?number
speed?number

Defined in

@types/index.ts:421


TrackInfo

Ƭ TrackInfo: Object

Type declaration

NameType
authorstring
identifierstring
isSeekableboolean
isStreamboolean
lengthnumber
positionnumber
sourceNamestring | null
thumbnail?string
titlestring
uristring

Defined in

@types/index.ts:136


TremoloOptions

Ƭ TremoloOptions: Object

Type declaration

NameType
depth?number
frequency?number

Defined in

@types/index.ts:427


UpdatePlayerOptions

Ƭ UpdatePlayerOptions: Object

----- REST API -----

Type declaration

NameTypeDescription
encodedTrack?string | null-
endTime?number-
filters?FilterOptions-
noReplace?boolean-
paused?boolean-
position?numberidentifier?: string;
voice?{ endpoint: string ; sessionId: string ; token: string }-
voice.endpointstring-
voice.sessionIdstring-
voice.tokenstring-
volume?number-

Defined in

@types/index.ts:98


VibratoOptions

Ƭ VibratoOptions: Object

Type declaration

NameType
depth?number
frequency?number

Defined in

@types/index.ts:432


VoiceServerUpdatePayload

Ƭ VoiceServerUpdatePayload: IncomingDiscordPayload & { d: VoiceServerUpdateData ; t: "VOICE_SERVER_UPDATE" }

Defined in

@types/index.ts:37


VoiceState

Ƭ VoiceState: Object

Type declaration

NameType
event?VoiceServerUpdateData
sessionId?string

Defined in

@types/index.ts:359


VoiceStateUpdatePayload

Ƭ VoiceStateUpdatePayload: IncomingDiscordPayload & { d: { channel_id: string | null ; guild_id: string ; session_id: string ; user_id: string } ; t: "VOICE_STATE_UPDATE" }

Defined in

@types/index.ts:21


version

Ƭ version: string

Lavalink version

Defined in

@types/index.ts:257