documentation
This commit is contained in:
parent
c212ba6d3f
commit
e978cf4665
3 changed files with 63 additions and 55 deletions
|
@ -12,8 +12,8 @@
|
||||||
"build": "rimraf lib && tsc",
|
"build": "rimraf lib && tsc",
|
||||||
"format": "prettier --write \"src/**/*.ts\" \"example/**/*.ts\"",
|
"format": "prettier --write \"src/**/*.ts\" \"example/**/*.ts\"",
|
||||||
"lint": "tslint -p tsconfig.json",
|
"lint": "tslint -p tsconfig.json",
|
||||||
"docs": "docgen --jsdoc jsdoc.json --verbose --source src/*.ts src/**/*.ts --custom docs/index.yml --output docs/docs.json",
|
"docs": "docgen --jsdoc jsdoc.json --source src/*.ts src/**/*.ts --custom docs/index.yml --output docs/docs.json",
|
||||||
"docs:test": "docgen --jsdoc jsdoc.json --verbose --source src/*.ts src/**/*.ts --custom docs/index.yml"
|
"docs:test": "docgen --jsdoc jsdoc.json --source src/*.ts src/**/*.ts --custom docs/index.yml"
|
||||||
},
|
},
|
||||||
"funding": "https://github.com/Androz2091/discord-player?sponsor=1",
|
"funding": "https://github.com/Androz2091/discord-player?sponsor=1",
|
||||||
"contributors": [
|
"contributors": [
|
||||||
|
|
|
@ -456,4 +456,65 @@ class Player extends EventEmitter<PlayerEvents> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Emitted when bot gets disconnected from a voice channel
|
||||||
|
* @event Player#botDisconnect
|
||||||
|
* @param {Queue} queue The queue
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Emitted when the voice channel is empty
|
||||||
|
* @event Player#channelEmpty
|
||||||
|
* @param {Queue} queue The queue
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Emitted when bot connects to a voice channel
|
||||||
|
* @event Player#connectionCreate
|
||||||
|
* @param {Queue} queue The queue
|
||||||
|
* @param {StreamDispatcher} connection The discord player connection object
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Debug information
|
||||||
|
* @event Player#debug
|
||||||
|
* @param {Queue} queue The queue
|
||||||
|
* @param {string} message The message
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Emitted on error
|
||||||
|
* <warn>This event should handled properly otherwise it may crash your process!</warn>
|
||||||
|
* @event Player#error
|
||||||
|
* @param {Queue} queue The queue
|
||||||
|
* @param {Error} error The error
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Emitted when queue ends
|
||||||
|
* @event Player#queueEnd
|
||||||
|
* @param {Queue} queue The queue
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Emitted when a single track is added
|
||||||
|
* @event Player#trackAdd
|
||||||
|
* @param {Queue} queue The queue
|
||||||
|
* @param {Track} track The track
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Emitted when multiple tracks are added
|
||||||
|
* @event Player#tracksAdd
|
||||||
|
* @param {Queue} queue The queue
|
||||||
|
* @param {Track[]} tracks The tracks
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Emitted when a track starts playing
|
||||||
|
* @event Player#trackStart
|
||||||
|
* @param {Queue} queue The queue
|
||||||
|
* @param {Track} track The track
|
||||||
|
*/
|
||||||
|
|
||||||
export { Player };
|
export { Player };
|
||||||
|
|
|
@ -138,74 +138,21 @@ export enum QueryType {
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface PlayerEvents {
|
export interface PlayerEvents {
|
||||||
/**
|
|
||||||
* Emitted when bot gets disconnected from a voice channel
|
|
||||||
* @event Player#botDisconnect
|
|
||||||
* @param {Queue} queue The queue
|
|
||||||
*/
|
|
||||||
botDisconnect: (queue: Queue) => any;
|
botDisconnect: (queue: Queue) => any;
|
||||||
|
|
||||||
/**
|
|
||||||
* Emitted when the voice channel is empty
|
|
||||||
* @event Player#channelEmpty
|
|
||||||
* @param {Queue} queue The queue
|
|
||||||
*/
|
|
||||||
channelEmpty: (queue: Queue) => any;
|
channelEmpty: (queue: Queue) => any;
|
||||||
|
|
||||||
/**
|
|
||||||
* Emitted when bot connects to a voice channel
|
|
||||||
* @event Player#connectionCreate
|
|
||||||
* @param {Queue} queue The queue
|
|
||||||
* @param {StreamDispatcher} connection The discord player connection object
|
|
||||||
*/
|
|
||||||
connectionCreate: (queue: Queue, connection: StreamDispatcher) => any;
|
connectionCreate: (queue: Queue, connection: StreamDispatcher) => any;
|
||||||
|
|
||||||
/**
|
|
||||||
* Debug information
|
|
||||||
* @event Player#debug
|
|
||||||
* @param {Queue} queue The queue
|
|
||||||
* @param {string} message The message
|
|
||||||
*/
|
|
||||||
debug: (queue: Queue, message: string) => any;
|
debug: (queue: Queue, message: string) => any;
|
||||||
|
|
||||||
/**
|
|
||||||
* Emitted on error
|
|
||||||
* <warn>This event should handled properly otherwise it may crash your process!</warn>
|
|
||||||
* @event Player#error
|
|
||||||
* @param {Queue} queue The queue
|
|
||||||
* @param {Error} error The error
|
|
||||||
*/
|
|
||||||
error: (queue: Queue, error: Error) => any;
|
error: (queue: Queue, error: Error) => any;
|
||||||
|
|
||||||
/**
|
|
||||||
* Emitted when queue ends
|
|
||||||
* @event Player#queueEnd
|
|
||||||
* @param {Queue} queue The queue
|
|
||||||
*/
|
|
||||||
queueEnd: (queue: Queue) => any;
|
queueEnd: (queue: Queue) => any;
|
||||||
|
|
||||||
/**
|
|
||||||
* Emitted when a single track is added
|
|
||||||
* @event Player#trackAdd
|
|
||||||
* @param {Queue} queue The queue
|
|
||||||
* @param {Track} track The track
|
|
||||||
*/
|
|
||||||
trackAdd: (queue: Queue, track: Track) => any;
|
trackAdd: (queue: Queue, track: Track) => any;
|
||||||
|
|
||||||
/**
|
|
||||||
* Emitted when multiple tracks are added
|
|
||||||
* @event Player#tracksAdd
|
|
||||||
* @param {Queue} queue The queue
|
|
||||||
* @param {Track[]} tracks The tracks
|
|
||||||
*/
|
|
||||||
tracksAdd: (queue: Queue, track: Track[]) => any;
|
tracksAdd: (queue: Queue, track: Track[]) => any;
|
||||||
|
|
||||||
/**
|
|
||||||
* Emitted when a track starts playing
|
|
||||||
* @event Player#trackStart
|
|
||||||
* @param {Queue} queue The queue
|
|
||||||
* @param {Track} track The track
|
|
||||||
*/
|
|
||||||
trackStart: (queue: Queue, track: Track) => any;
|
trackStart: (queue: Queue, track: Track) => any;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue