Added Track as a valid query type for play() method (#148)

Co-authored-by: Androz <androz2091@gmail.com>
This commit is contained in:
Taso 2020-11-10 11:16:18 -05:00 committed by GitHub
parent 5e3075dad1
commit a26b764b71
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 4 deletions

View file

@ -29,6 +29,7 @@
},
"homepage": "https://github.com/Androz2091/discord-player#readme",
"dependencies": {
"@types/node": "^14.14.7",
"discord-ytdl-core": "^4.1.3",
"merge-options": "^2.0.0",
"moment": "^2.27.0",

View file

@ -319,9 +319,9 @@ class Player extends EventEmitter {
}
/**
* Play a track in the server. Supported query types are `keywords`, YouTube video links`, `YouTube playlists links`, Spotify track link` or `SoundCloud song link`.
* @param {Discord.Message} message
* @param {String} query
* Play a track in the server. Supported query types are `keywords`, `YouTube video links`, `YouTube playlists links`, `Spotify track link` or `SoundCloud song link`.
* @param {Discord.Message} message Discord `message`
* @param {String|Track} query Search query or a valid `Track` object.
* @returns {Promise<void>}
*
* @example

2
typings/index.d.ts vendored
View file

@ -25,7 +25,7 @@ declare module 'discord-player' {
public isPlaying(message: Message): boolean;
public setFilters(message: Message, newFilters: Partial<Filters>): Promise<void>;
public play(message: Message, query: string): Promise<void>;
public play(message: Message, query: string | Track): Promise<void>;
public pause(message: Message): void;
public resume(message: Message): void;
public stop(message: Message): void;