mirror of
https://github.com/danbulant/discord.js
synced 2026-06-08 09:13:22 +00:00
Allow the class objects to be accessed
This commit is contained in:
parent
fa7fb4bd37
commit
76cf78c5a1
1 changed files with 15 additions and 0 deletions
15
index.js
15
index.js
|
|
@ -9,6 +9,15 @@ var Invite = require( "./lib/invite.js" ).Invite;
|
||||||
var PMChannel = require( "./lib/PMChannel.js" ).PMChannel;
|
var PMChannel = require( "./lib/PMChannel.js" ).PMChannel;
|
||||||
var WebSocket = require( 'ws' );
|
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){
|
exports.isUserID = function(id){
|
||||||
return ((id + "").length === 17 && !isNaN(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 channelList = this.serverList.concatSublists( "channels", "id" );
|
||||||
var channel = channelList.filter( "id", id, true );
|
var channel = channelList.filter( "id", id, true );
|
||||||
|
|
||||||
|
if(!channel){
|
||||||
|
|
||||||
|
channel = this.PMList.filter( "id", id, true);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return channel;
|
return channel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue