diff --git a/src/Player.ts b/src/Player.ts index 64c7f77..65474e4 100644 --- a/src/Player.ts +++ b/src/Player.ts @@ -1133,6 +1133,7 @@ export class Player extends EventEmitter { if (!channel) return void this.emit(PlayerEvents.ERROR, PlayerErrorEventCodes.NOT_CONNECTED, message, new PlayerError('Voice connection is not available in this server!')); const queue = new Queue(this, message); + queue.volume = this.options.volume || 100; this.queues.set(message.guild.id, queue); channel @@ -1254,6 +1255,8 @@ export class Player extends EventEmitter { let newStream: any; + if (!queue.playing?.raw?.source) return void this.emit(PlayerEvents.ERROR, PlayerErrorEventCodes.VIDEO_UNAVAILABLE, queue.firstMessage, queue.playing, new PlayerError('Don\'t know how to play this item', 'PlayerError')); + // modify spotify if (queue.playing.raw.source === 'spotify' && !(queue.playing as any).backupLink) { const searchQueryString = this.options.disableArtistSearch ? queue.playing.title : `${queue.playing.title}${' - ' + queue.playing.author}`; @@ -1446,6 +1449,7 @@ export default Player; * @property {Boolean} [disableAutoRegister=false] If it should disable auto-registeration of `@discord-player/extractor` * @property {Boolean} [disableArtistSearch=false] If it should disable artist search for spotify * @property {Boolean} [fetchBeforeQueued=false] If it should fetch all songs loaded from spotify before playing + * @property {Number} [volume=100] Startup player volume */ /** @@ -1513,6 +1517,8 @@ export default Player; * @property {Boolean} [timecodes] If it should return progres bar with time codes * @property {Boolean} [queue] if it should return the progress bar of the whole queue * @property {Number} [length] The length of progress bar to build + * @property {String} [indicator] The progress indicator + * @property {String} [line] The progress bar track */ /** diff --git a/src/types/types.ts b/src/types/types.ts index fe91ad3..00af839 100644 --- a/src/types/types.ts +++ b/src/types/types.ts @@ -15,6 +15,7 @@ export interface PlayerOptions { disableAutoRegister?: boolean; disableArtistSearch?: boolean; fetchBeforeQueued?: boolean; + volume?: number; } export type FiltersName = keyof QueueFilters; diff --git a/src/utils/Constants.ts b/src/utils/Constants.ts index afa41d5..8a08c07 100644 --- a/src/utils/Constants.ts +++ b/src/utils/Constants.ts @@ -36,5 +36,6 @@ export const PlayerOptions: DP_OPTIONS = { leaveOnEmptyCooldown: 0, autoSelfDeaf: true, enableLive: false, - ytdlDownloadOptions: {} + ytdlDownloadOptions: {}, + volume: 100 };