feat: ClientUserSettingManager
This commit is contained in:
@@ -12,6 +12,7 @@ const { Error, TypeError, RangeError } = require('../errors');
|
||||
const BaseGuildEmojiManager = require('../managers/BaseGuildEmojiManager');
|
||||
const BillingManager = require('../managers/BillingManager');
|
||||
const ChannelManager = require('../managers/ChannelManager');
|
||||
const ClientUserSettingManager = require('../managers/ClientUserSettingManager');
|
||||
const GuildManager = require('../managers/GuildManager');
|
||||
const PresenceManager = require('../managers/PresenceManager');
|
||||
const RelationshipManager = require('../managers/RelationshipManager');
|
||||
@@ -188,6 +189,12 @@ class Client extends BaseClient {
|
||||
*/
|
||||
this.billing = new BillingManager(this);
|
||||
|
||||
/**
|
||||
* All of the settings {@link Object}
|
||||
* @type {ClientUserSettingManager}
|
||||
*/
|
||||
this.settings = new ClientUserSettingManager(this);
|
||||
|
||||
Object.defineProperty(this, 'token', { writable: true });
|
||||
if (!this.token && 'DISCORD_TOKEN' in process.env) {
|
||||
/**
|
||||
|
@@ -35,6 +35,9 @@ module.exports = (client, { d: data }, shard) => {
|
||||
// Relationship
|
||||
client.relationships._setup(data.relationships);
|
||||
|
||||
// ClientSetting
|
||||
client.settings._patch(data.user_settings);
|
||||
|
||||
Promise.all(
|
||||
largeGuilds.map(async (guild, index) => {
|
||||
client.ws.broadcast({
|
||||
|
5
src/client/websocket/handlers/USER_SETTINGS_UPDATE.js
Normal file
5
src/client/websocket/handlers/USER_SETTINGS_UPDATE.js
Normal file
@@ -0,0 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = (client, { d: data }) => {
|
||||
client.settings._patch(data);
|
||||
};
|
@@ -73,6 +73,7 @@ const handlers = Object.fromEntries([
|
||||
['CALL_CREATE', require('./CALL_CREATE')],
|
||||
['CALL_UPDATE', require('./CALL_UPDATE')],
|
||||
['CALL_DELETE', require('./CALL_DELETE')],
|
||||
['USER_SETTINGS_UPDATE', require('./USER_SETTINGS_UPDATE')],
|
||||
]);
|
||||
|
||||
module.exports = handlers;
|
||||
|
Reference in New Issue
Block a user