From 76cf78c5a135d7e55c678bf916fb8041aa4728e4 Mon Sep 17 00:00:00 2001 From: hydrabolt Date: Fri, 14 Aug 2015 13:37:07 +0100 Subject: [PATCH] Allow the class objects to be accessed --- index.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/index.js b/index.js index 6b7ae6d6c..73bb2432d 100644 --- a/index.js +++ b/index.js @@ -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; }