mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 00:53:31 +01:00
Fixed a bunch of ClientUserGuildSettings stuff and its docs (#1758)
This commit is contained in:
@@ -4,8 +4,7 @@ const Constants = require('../util/Constants');
|
||||
* A wrapper around the ClientUser's channel overrides.
|
||||
*/
|
||||
class ClientUserChannelOverride {
|
||||
constructor(user, data) {
|
||||
this.user = user;
|
||||
constructor(data) {
|
||||
this.patch(data);
|
||||
}
|
||||
|
||||
@@ -14,8 +13,7 @@ class ClientUserChannelOverride {
|
||||
* @param {Object} data Data to patch this with
|
||||
*/
|
||||
patch(data) {
|
||||
for (const key of Object.keys(Constants.UserChannelOverrideMap)) {
|
||||
const value = Constants.UserChannelOverrideMap[key];
|
||||
for (const [key, value] of Object.entries(Constants.UserChannelOverrideMap)) {
|
||||
if (!data.hasOwnProperty(key)) continue;
|
||||
if (typeof value === 'function') {
|
||||
this[value.name] = value(data[key]);
|
||||
|
||||
Reference in New Issue
Block a user