mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 16:43:31 +01:00
Add user_guild_settings support (#1365)
* user guild settings
* Use direct collection
* I'm a goof
* double goof
* Structure properties
* Forgot to register listener
* wrong class names
* No more get in docs
* avoid waterfalls, bot checks
* trycatch
wow i thought i already did this :notlikecat:
* 👀
* Update ClientUser.js
* Update ClientUserGuildSettings.js
* Update UserGuildSettingsUpdate.js
* Update ClientUserChannelOverride.js
* Update ClientUserGuildSettings.js
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
const User = require('./User');
|
||||
const Collection = require('../util/Collection');
|
||||
const ClientUserSettings = require('./ClientUserSettings');
|
||||
const ClientUserGuildSettings = require('./ClientUserGuildSettings');
|
||||
const Constants = require('../util/Constants');
|
||||
const Util = require('../util/Util');
|
||||
const Guild = require('./Guild');
|
||||
@@ -78,6 +79,19 @@ class ClientUser extends User {
|
||||
* @type {?ClientUserSettings}
|
||||
*/
|
||||
if (data.user_settings) this.settings = new ClientUserSettings(this, data.user_settings);
|
||||
|
||||
/**
|
||||
* All of the user's guild settings
|
||||
* @type {Collection<Snowflake, ClientUserGuildSettings>}
|
||||
* <warn>This is only filled when using a user account</warn>
|
||||
*/
|
||||
this.guildSettings = new Collection();
|
||||
if (data.user_guild_settings) {
|
||||
for (const settings of data.user_guild_settings) {
|
||||
const guild = this.client.guilds.get(settings.guild_id);
|
||||
this.guildSettings.set(guild.id, new ClientUserGuildSettings(settings, guild));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
edit(data, password) {
|
||||
|
||||
Reference in New Issue
Block a user