User settings (#1337)

* user settings bruh

* remove development dump

* emit stuff

* i am so done

* Update ClientUserSettings.js

* modularize

* Update ClientUserSettings.js

* Update Constants.js

* Update ClientUserSettings.js

* Update RESTMethods.js

* Update ClientUserSettings.js

* <.<
This commit is contained in:
Gus Caplan
2017-04-05 15:03:33 -05:00
committed by Crawl
parent 5d85de0883
commit 801633b970
11 changed files with 291 additions and 12 deletions

View File

@@ -1,6 +1,6 @@
const User = require('./User');
const Collection = require('../util/Collection');
const ClientUserSettings = require('./ClientUserSettings');
/**
* Represents the logged in client's Discord user
* @extends {User}
@@ -44,13 +44,6 @@ class ClientUser extends User {
*/
this.notes = new Collection();
/**
* Discord client settings, such as guild positions
* <warn>This is only filled when using a user account.</warn>
* @type {Object}
*/
this.settings = {};
/**
* If the user has discord premium (nitro)
* <warn>This is only filled when using a user account.</warn>
@@ -71,6 +64,13 @@ class ClientUser extends User {
* @type {?boolean}
*/
this.mobile = typeof data.mobile === 'boolean' ? data.mobile : null;
/**
* Various settings for this user
* @type {?ClientUserSettings}
* <warn>This is only filled when using a user account</warn>
*/
if (data.user_settings) this.settings = new ClientUserSettings(this, data.user_settings);
}
edit(data) {