setAutoPlay should return boolean

This commit is contained in:
Snowflake107 2021-04-19 20:39:47 +05:45
parent c2f3190f59
commit 893767a211

View file

@ -891,11 +891,13 @@ export class Player extends EventEmitter {
* @param message The message object * @param message The message object
* @param enable Enable/Disable autoplay * @param enable Enable/Disable autoplay
*/ */
setAutoPlay(message: Message, enable: boolean): void { setAutoPlay(message: Message, enable: boolean): boolean {
const queue = this.getQueue(message); const queue = this.getQueue(message);
if (!queue) return void this.emit(PlayerEvents.ERROR, PlayerErrorEventCodes.NOT_PLAYING, message); if (!queue) return void this.emit(PlayerEvents.ERROR, PlayerErrorEventCodes.NOT_PLAYING, message);
queue.autoPlay = Boolean(enable); queue.autoPlay = Boolean(enable);
return queue.autoPlay;
} }
/** /**