channelLeave(name) {
		const { chat } = this.properties
		if(chat.channel.disconnected === true) {
			const index = chat.channels.findIndex(channel => channel.name === name)
			chat.channels.splice(index, 1)
			chat.emit("channelLeft", name)
			if (chat.channels.length >= 1) {
				chat.channel = chat.channels[0]
				chat.emit("channelSet", chat.channels[0])
			} else {
				chat.channel = null
			}
		} else if(chat.channel === null) {
			chat.emit("messagePrint", { type: Chat.MESSAGE_TYPE.NETWORK, content: "No channel joined. Try /join #<channel>" })
		} else {
			chat.socket.emit(ChatServer.EVENT.CHANNEL_LEAVE, name)
		}
	}
/**
	 * @event ChannelsEventListener#channelLeave
	 * @property {string} name
	 */
@event ChannelsEventListener#channelLeave
@property {string} name
@event ChannelsEventListener#channelLeave @property { string } name
channelLeave(name) {
		const { chat } = this.properties
		if(chat.channel.disconnected === true) {
			const index = chat.channels.findIndex(channel => channel.name === name)
			chat.channels.splice(index, 1)
			chat.emit("channelLeft", name)
			if (chat.channels.length >= 1) {
				chat.channel = chat.channels[0]
				chat.emit("channelSet", chat.channels[0])
			} else {
				chat.channel = null
			}
		} else if(chat.channel === null) {
			chat.emit("messagePrint", { type: Chat.MESSAGE_TYPE.NETWORK, content: "No channel joined. Try /join #<channel>" })
		} else {
			chat.socket.emit(ChatServer.EVENT.CHANNEL_LEAVE, name)
		}
	}
channelLeave ( name ) { const { chat } = this . properties if ( chat . channel . disconnected === true ) { const index = chat . channels . findIndex ( channel => channel . name === name ) chat . channels . splice ( index , 1 ) chat . emit ( "channelLeft" , name ) if ( chat . channels . length >= 1 ) { chat . channel = chat . channels [ 0 ] chat . emit ( "channelSet" , chat . channels [ 0 ] ) } else { chat . channel = null } } else if ( chat . channel === null ) { chat . emit ( "messagePrint" , { type : Chat . MESSAGE_TYPE . NETWORK , content : "No channel joined. Try /join #<channel>" } ) } else { chat . socket . emit ( ChatServer . EVENT . CHANNEL_LEAVE , name ) } }
@event ChannelsEventListener#channelLeave
 @property {string} name
@event ChannelsEventListener#channelLeave @property { string } name