mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 10:33:30 +01:00
Fixed invites
This commit is contained in:
114
lib/channel.js
114
lib/channel.js
@@ -5,70 +5,70 @@ var _createClass = (function () { function defineProperties(target, props) { for
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
var Channel = (function () {
|
||||
function Channel(data, server) {
|
||||
_classCallCheck(this, Channel);
|
||||
function Channel(data, server) {
|
||||
_classCallCheck(this, Channel);
|
||||
|
||||
this.server = server;
|
||||
this.name = data.name;
|
||||
this.type = data.type;
|
||||
this.id = data.id;
|
||||
this.messages = [];
|
||||
//this.isPrivate = isPrivate; //not sure about the implementation of this...
|
||||
}
|
||||
|
||||
_createClass(Channel, [{
|
||||
key: "equals",
|
||||
value: function equals(object) {
|
||||
return object.id === this.id;
|
||||
this.server = server;
|
||||
this.name = data.name;
|
||||
this.type = data.type;
|
||||
this.id = data.id;
|
||||
this.messages = [];
|
||||
//this.isPrivate = isPrivate; //not sure about the implementation of this...
|
||||
}
|
||||
}, {
|
||||
key: "addMessage",
|
||||
value: function addMessage(data) {
|
||||
if (!this.getMessage("id", data.id)) {
|
||||
this.messages.push(data);
|
||||
}
|
||||
return this.getMessage("id", data.id);
|
||||
}
|
||||
}, {
|
||||
key: "getMessage",
|
||||
value: function getMessage(key, value) {
|
||||
var _iteratorNormalCompletion = true;
|
||||
var _didIteratorError = false;
|
||||
var _iteratorError = undefined;
|
||||
|
||||
try {
|
||||
for (var _iterator = this.messages[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
||||
var message = _step.value;
|
||||
|
||||
if (message[key] === value) {
|
||||
return message;
|
||||
}
|
||||
_createClass(Channel, [{
|
||||
key: "equals",
|
||||
value: function equals(object) {
|
||||
return object.id === this.id;
|
||||
}
|
||||
} catch (err) {
|
||||
_didIteratorError = true;
|
||||
_iteratorError = err;
|
||||
} finally {
|
||||
try {
|
||||
if (!_iteratorNormalCompletion && _iterator["return"]) {
|
||||
_iterator["return"]();
|
||||
}
|
||||
} finally {
|
||||
if (_didIteratorError) {
|
||||
throw _iteratorError;
|
||||
}
|
||||
}, {
|
||||
key: "addMessage",
|
||||
value: function addMessage(data) {
|
||||
if (!this.getMessage("id", data.id)) {
|
||||
this.messages.push(data);
|
||||
}
|
||||
return this.getMessage("id", data.id);
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "getMessage",
|
||||
value: function getMessage(key, value) {
|
||||
var _iteratorNormalCompletion = true;
|
||||
var _didIteratorError = false;
|
||||
var _iteratorError = undefined;
|
||||
|
||||
return null;
|
||||
}
|
||||
}, {
|
||||
key: "client",
|
||||
get: function get() {
|
||||
return this.server.client;
|
||||
}
|
||||
}]);
|
||||
try {
|
||||
for (var _iterator = this.messages[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
||||
var message = _step.value;
|
||||
|
||||
return Channel;
|
||||
if (message[key] === value) {
|
||||
return message;
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
_didIteratorError = true;
|
||||
_iteratorError = err;
|
||||
} finally {
|
||||
try {
|
||||
if (!_iteratorNormalCompletion && _iterator["return"]) {
|
||||
_iterator["return"]();
|
||||
}
|
||||
} finally {
|
||||
if (_didIteratorError) {
|
||||
throw _iteratorError;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}, {
|
||||
key: "client",
|
||||
get: function get() {
|
||||
return this.server.client;
|
||||
}
|
||||
}]);
|
||||
|
||||
return Channel;
|
||||
})();
|
||||
|
||||
module.exports = Channel;
|
||||
Reference in New Issue
Block a user