mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 16:43:31 +01:00
add .toObject() method to structures (#522)
* add .toObject() method to structures * add compiled PMChannel change from last commit * uncomment members in VoiceChannel toObject method
This commit is contained in:
@@ -44,6 +44,30 @@ var PMChannel = (function (_Channel) {
|
||||
return this.recipient.toString();
|
||||
};
|
||||
|
||||
PMChannel.prototype.toObject = function toObject() {
|
||||
var keys = ['type', 'lastMessageID', 'recipient'],
|
||||
obj = {};
|
||||
|
||||
for (var _iterator = keys, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
|
||||
var _ref;
|
||||
|
||||
if (_isArray) {
|
||||
if (_i >= _iterator.length) break;
|
||||
_ref = _iterator[_i++];
|
||||
} else {
|
||||
_i = _iterator.next();
|
||||
if (_i.done) break;
|
||||
_ref = _i.value;
|
||||
}
|
||||
|
||||
var k = _ref;
|
||||
|
||||
obj[k] = this[k];
|
||||
}
|
||||
|
||||
return obj;
|
||||
};
|
||||
|
||||
PMChannel.prototype.sendMessage = function sendMessage() {
|
||||
return this.client.sendMessage.apply(this.client, _UtilArgumentRegulariser.reg(this, arguments));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user