SalvageMusic

SalvageMusic

new SalvageMusic(client, nodes, messages)

The main constructor / class for salvage-music

Parameters:
Name Type Description
client Client

Your discord bot client

nodes Array.<SalvageNode>

Your lavalink nodes

messages SalvageMessages

The messages for your bot

Methods

(private) checkURL(string)

Will return true if it is a valid url, false if it isn't. This is a utility, recommended you don't use it.

Parameters:
Name Type Description
string String

A string to test

getQueue(message)

Will get the current playing song and the queue for the guild if it exists, if it doesn't it will return false.

Parameters:
Name Type Description
message Message

The message instance

(async) pause(message)

Will return true if success, false if failed. Will make the bot pause the music if it is currently playing.

Parameters:
Name Type Description
message Message

The message instance

(async) resume(message)

Will return true if success, false if failed. Will make the bot resume the music if it is currently paused.

Parameters:
Name Type Description
message Message

The message instance

(async) searchAndPlay(node, query, service, message)

This will search and play a song if it finds one, it accepts a url and a query. If it works, it'll return an object containing data on what was played, if it was a playlist etc.

Parameters:
Name Type Description
node Shoukaku.ShoukakuSocket

The node

query String

The query

service 'youtube' | 'soundcloud'

The service, either youtube or soundcloud

message Message

A message instance

(async) setVolume(message, amount)

Will return true if success, false if failed. Will set the volume of the bot in a guild.

Parameters:
Name Type Description
message Message

The message instance

amount Number

The amount to set the volume to

(async) skip(message)

Will return true if success, false if failed. Will skip the current playing song

Parameters:
Name Type Description
message Message

The message instance

(async) stop(message)

Will return true if success, false if failed. Will make the bot leave the voice channel and delete the queue for that guild.

Parameters:
Name Type Description
message Message

The message instance