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:
Brian Tanner
2016-08-16 23:53:07 +07:00
committed by abal
parent e42178181d
commit fdfd41dd8c
21 changed files with 426 additions and 58 deletions

View File

@@ -43,6 +43,17 @@ export default class PermissionOverwrite {
return denied;
}
toObject() {
let keys = ['id', 'type', 'allow', 'deny'],
obj = {};
for (let k of keys) {
obj[k] = this[k];
}
return obj;
}
setAllowed(allowedArray){
allowedArray.forEach( (permission) => {
if(permission instanceof String || typeof permission === "string"){