Open MrJacz opened 6 years ago
I don't think there's any need for a PlayerManager.add method, the only reason it existed in eris-lavalink was because it was extending Eris.Collection and there was some code reuse, by adding that method you'll only save 1 line of code.
Also, regarding _
private methods, I think the @private
distinction in the jsdoc should be enough.
Im not taking the idea for the add method from Eris#Collection but its would be handy considering then
player = player || new this.baseObject(data.guild_id, { // eslint-disable-line
client: this.client,
guildId: data.guild_id,
sessionId: data.session_id,
channelId: this.pendingGuilds[data.guild_id].channelId,
hostname: this.pendingGuilds[data.guild_id].hostname,
node: this.pendingGuilds[data.guild_id].node,
options: this.pendingGuilds[data.guild_id].options,
event: data,
manager: this
});
this.set(data.guild_id, player);
could be reduced to
player = player || this.add(data here);
and for the _
private methods, I do agree
We'll never use that method again, just to save one line of code.
Done: PlayerManager#Join function returns promise off the bat
Todo: Better error handling and type checking