mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-13 18:13:29 +01:00
rewriting... woo
This commit is contained in:
@@ -1,28 +1,21 @@
|
||||
var List = require("./list.js").List;
|
||||
class Channel {
|
||||
|
||||
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;
|
||||
constructor(data, server) {
|
||||
this.server = server;
|
||||
this.name = data.name;
|
||||
this.type = data.type;
|
||||
this.id = data.id;
|
||||
//this.isPrivate = isPrivate; //not sure about the implementation of this...
|
||||
}
|
||||
|
||||
get client() {
|
||||
return this.server.client;
|
||||
}
|
||||
|
||||
equals(object) {
|
||||
return object.id === this.id;
|
||||
}
|
||||
|
||||
this.name = name;
|
||||
this.server = server;
|
||||
this.type = type;
|
||||
this.id = id;
|
||||
this.isPrivate = isPrivate;
|
||||
this.messages = new List("id", 5000);
|
||||
}
|
||||
|
||||
exports.Channel.equals = function(otherChannel){
|
||||
if(otherChannel.id === this.id){
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
module.exports = Channel;
|
||||
Reference in New Issue
Block a user