mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 00:53: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:
@@ -31,6 +31,18 @@ var VoiceChannel = (function (_ServerChannel) {
|
||||
this.bitrate = Math.round(this._bitrate / 1000); // store as kbps
|
||||
}
|
||||
|
||||
VoiceChannel.prototype.toObject = function toObject() {
|
||||
var obj = _ServerChannel.prototype.toObject.call(this);
|
||||
|
||||
obj.userLimit = this.userLimit;
|
||||
obj.bitrate = this.bitrate;
|
||||
obj.members = this.members.map(function (member) {
|
||||
return member.toObject();
|
||||
});
|
||||
|
||||
return obj;
|
||||
};
|
||||
|
||||
VoiceChannel.prototype.join = function join() {
|
||||
var callback = arguments.length <= 0 || arguments[0] === undefined ? function () {} : arguments[0];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user