mirror of
https://github.com/discordjs/discord.js.git
synced 2024-08-20 23:14:44 +12:00
Merge branch 'master' into hydrabot
This commit is contained in:
commit
0a278a32f3
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 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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue