mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 19:43:29 +01:00
Merge branch 'master' into hydrabot
This commit is contained in:
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user