Allow the class objects to be accessed

This commit is contained in:
hydrabolt 2015-08-14 13:37:07 +01:00
parent fa7fb4bd37
commit 76cf78c5a1

View file

@ -9,6 +9,15 @@ var Invite = require( "./lib/invite.js" ).Invite;
var PMChannel = require( "./lib/PMChannel.js" ).PMChannel;
var WebSocket = require( 'ws' );
exports.Endpoints = Endpoints;
exports.Server = Server;
exports.Message = Message;
exports.User = User;
exports.Channel = Channel;
exports.List = List;
exports.Invite = Invite;
exports.PMChannel = PMChannel;
exports.isUserID = function(id){
return ((id + "").length === 17 && !isNaN(id));
}
@ -479,6 +488,12 @@ exports.Client.prototype.channelFromId = function( id ) {
var channelList = this.serverList.concatSublists( "channels", "id" );
var channel = channelList.filter( "id", id, true );
if(!channel){
channel = this.PMList.filter( "id", id, true);
}
return channel;
}