mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 19:43:29 +01:00
Made it better! Much better caching
This commit is contained in:
@@ -1,7 +1,16 @@
|
||||
exports.Channel = function(name, serverId, type, id, isPrivate){
|
||||
exports.Channel = function(name, server, type, id, isPrivate){
|
||||
|
||||
if(!type){ //there's no second argument
|
||||
var channel = name;
|
||||
name = channel.name;
|
||||
server = server;
|
||||
type = channel.type;
|
||||
id = channel.id;
|
||||
isPrivate = channel.is_private;
|
||||
}
|
||||
|
||||
this.name = name;
|
||||
this.serverId = serverId;
|
||||
this.server = server;
|
||||
this.type = type;
|
||||
this.id = id;
|
||||
this.isPrivate = isPrivate;
|
||||
@@ -9,11 +18,9 @@ exports.Channel = function(name, serverId, type, id, isPrivate){
|
||||
}
|
||||
|
||||
exports.Channel.equals = function(otherChannel){
|
||||
|
||||
if(otherChannel.id === this.id){
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user