mirror of
https://github.com/danbulant/discord.js
synced 2026-07-05 19:20:42 +00:00
Webpack build for branch master: fa5c4efa2b
This commit is contained in:
parent
1a0ceaf181
commit
0e5480de4f
2 changed files with 39 additions and 26 deletions
|
|
@ -603,14 +603,14 @@ exports.UserChannelOverrideMap = {
|
||||||
/**
|
/**
|
||||||
* The type of message that should notify you
|
* The type of message that should notify you
|
||||||
* one of `EVERYTHING`, `MENTIONS`, `NOTHING`, `INHERIT`
|
* one of `EVERYTHING`, `MENTIONS`, `NOTHING`, `INHERIT`
|
||||||
* @name ClientUserChannelOverrides#messageNotifications
|
* @name ClientUserChannelOverride#messageNotifications
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
return exports.MessageNotificationTypes[type];
|
return exports.MessageNotificationTypes[type];
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Whether the guild is muted or not
|
* Whether the guild is muted or not
|
||||||
* @name ClientUserChannelOverrides#muted
|
* @name ClientUserChannelOverride#muted
|
||||||
* @type {boolean}
|
* @type {boolean}
|
||||||
*/
|
*/
|
||||||
muted: 'muted',
|
muted: 'muted',
|
||||||
|
|
@ -4894,7 +4894,7 @@ class User {
|
||||||
/**
|
/**
|
||||||
* The client that created the instance of the the user
|
* The client that created the instance of the the user
|
||||||
* @name User#client
|
* @name User#client
|
||||||
* @type {}
|
* @type {Client}
|
||||||
* @readonly
|
* @readonly
|
||||||
*/
|
*/
|
||||||
Object.defineProperty(this, 'client', { value: client });
|
Object.defineProperty(this, 'client', { value: client });
|
||||||
|
|
@ -7012,6 +7012,7 @@ class Guild {
|
||||||
* The position of this guild
|
* The position of this guild
|
||||||
* <warn>This is only available when using a user account.</warn>
|
* <warn>This is only available when using a user account.</warn>
|
||||||
* @type {?number}
|
* @type {?number}
|
||||||
|
* @readonly
|
||||||
*/
|
*/
|
||||||
get position() {
|
get position() {
|
||||||
if (this.client.user.bot) return null;
|
if (this.client.user.bot) return null;
|
||||||
|
|
@ -7023,6 +7024,7 @@ class Guild {
|
||||||
* Whether the guild is muted
|
* Whether the guild is muted
|
||||||
* <warn>This is only available when using a user account.</warn>
|
* <warn>This is only available when using a user account.</warn>
|
||||||
* @type {?boolean}
|
* @type {?boolean}
|
||||||
|
* @readonly
|
||||||
*/
|
*/
|
||||||
get muted() {
|
get muted() {
|
||||||
if (this.client.user.bot) return null;
|
if (this.client.user.bot) return null;
|
||||||
|
|
@ -7037,7 +7039,8 @@ class Guild {
|
||||||
* The type of message that should notify you
|
* The type of message that should notify you
|
||||||
* one of `EVERYTHING`, `MENTIONS`, `NOTHING`
|
* one of `EVERYTHING`, `MENTIONS`, `NOTHING`
|
||||||
* <warn>This is only available when using a user account.</warn>
|
* <warn>This is only available when using a user account.</warn>
|
||||||
* @type {string}
|
* @type {?string}
|
||||||
|
* @readonly
|
||||||
*/
|
*/
|
||||||
get messageNotifications() {
|
get messageNotifications() {
|
||||||
if (this.client.user.bot) return null;
|
if (this.client.user.bot) return null;
|
||||||
|
|
@ -7051,7 +7054,8 @@ class Guild {
|
||||||
/**
|
/**
|
||||||
* Whether to receive mobile push notifications
|
* Whether to receive mobile push notifications
|
||||||
* <warn>This is only available when using a user account.</warn>
|
* <warn>This is only available when using a user account.</warn>
|
||||||
* @type {boolean}
|
* @type {?boolean}
|
||||||
|
* @readonly
|
||||||
*/
|
*/
|
||||||
get mobilePush() {
|
get mobilePush() {
|
||||||
if (this.client.user.bot) return null;
|
if (this.client.user.bot) return null;
|
||||||
|
|
@ -7065,9 +7069,11 @@ class Guild {
|
||||||
/**
|
/**
|
||||||
* Whether to suppress everyone messages
|
* Whether to suppress everyone messages
|
||||||
* <warn>This is only available when using a user account.</warn>
|
* <warn>This is only available when using a user account.</warn>
|
||||||
* @type {boolean}
|
* @type {?boolean}
|
||||||
|
* @readonly
|
||||||
*/
|
*/
|
||||||
get suppressEveryone() {
|
get suppressEveryone() {
|
||||||
|
if (this.client.user.bot) return null;
|
||||||
try {
|
try {
|
||||||
return this.client.user.guildSettings.get(this.id).suppressEveryone;
|
return this.client.user.guildSettings.get(this.id).suppressEveryone;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
@ -9634,10 +9640,11 @@ class GuildChannel extends Channel {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether the channel is muted
|
* Whether the channel is muted
|
||||||
* <warn>This is only available when using a user account.</warn>
|
* <warn>This is only available when using a user account.</warn>
|
||||||
* @type {boolean}
|
* @type {?boolean}
|
||||||
*/
|
* @readonly
|
||||||
|
*/
|
||||||
get muted() {
|
get muted() {
|
||||||
if (this.client.user.bot) return null;
|
if (this.client.user.bot) return null;
|
||||||
try {
|
try {
|
||||||
|
|
@ -9651,7 +9658,8 @@ class GuildChannel extends Channel {
|
||||||
* The type of message that should notify you
|
* The type of message that should notify you
|
||||||
* one of `EVERYTHING`, `MENTIONS`, `NOTHING`, `INHERIT`
|
* one of `EVERYTHING`, `MENTIONS`, `NOTHING`, `INHERIT`
|
||||||
* <warn>This is only available when using a user account.</warn>
|
* <warn>This is only available when using a user account.</warn>
|
||||||
* @type {string}
|
* @type {?string}
|
||||||
|
* @readonly
|
||||||
*/
|
*/
|
||||||
get messageNotifications() {
|
get messageNotifications() {
|
||||||
if (this.client.user.bot) return null;
|
if (this.client.user.bot) return null;
|
||||||
|
|
@ -18131,9 +18139,7 @@ class ClientUser extends User {
|
||||||
this.guildSettings = new Collection();
|
this.guildSettings = new Collection();
|
||||||
if (data.user_guild_settings) {
|
if (data.user_guild_settings) {
|
||||||
for (const settings of data.user_guild_settings) {
|
for (const settings of data.user_guild_settings) {
|
||||||
settings.client = this.client;
|
this.guildSettings.set(settings.guild_id, new ClientUserGuildSettings(settings, this.client));
|
||||||
const guild = this.client.guilds.get(settings.guild_id);
|
|
||||||
this.guildSettings.set(settings.guild_id, new ClientUserGuildSettings(settings, guild));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -24251,9 +24257,19 @@ const ClientUserChannelOverride = __webpack_require__(129);
|
||||||
* A wrapper around the ClientUser's guild settings.
|
* A wrapper around the ClientUser's guild settings.
|
||||||
*/
|
*/
|
||||||
class ClientUserGuildSettings {
|
class ClientUserGuildSettings {
|
||||||
constructor(data, guild) {
|
constructor(data, client) {
|
||||||
this.guild = guild;
|
/**
|
||||||
this.client = data.client;
|
* The client that created the instance of the the user
|
||||||
|
* @name ClientUserGuildSettings#client
|
||||||
|
* @type {Client}
|
||||||
|
* @readonly
|
||||||
|
*/
|
||||||
|
Object.defineProperty(this, 'client', { value: client });
|
||||||
|
/**
|
||||||
|
* The ID of the guild this settings are for
|
||||||
|
* @type {Snowflake}
|
||||||
|
*/
|
||||||
|
this.guildID = data.guild_id;
|
||||||
this.channelOverrides = new Collection();
|
this.channelOverrides = new Collection();
|
||||||
this.patch(data);
|
this.patch(data);
|
||||||
}
|
}
|
||||||
|
|
@ -24263,13 +24279,12 @@ class ClientUserGuildSettings {
|
||||||
* @param {Object} data Data to patch this with
|
* @param {Object} data Data to patch this with
|
||||||
*/
|
*/
|
||||||
patch(data) {
|
patch(data) {
|
||||||
for (const key of Object.keys(Constants.UserGuildSettingsMap)) {
|
for (const [key, value] of Object.entries(Constants.UserGuildSettingsMap)) {
|
||||||
const value = Constants.UserGuildSettingsMap[key];
|
|
||||||
if (!data.hasOwnProperty(key)) continue;
|
if (!data.hasOwnProperty(key)) continue;
|
||||||
if (key === 'channel_overrides') {
|
if (key === 'channel_overrides') {
|
||||||
for (const channel of data[key]) {
|
for (const channel of data[key]) {
|
||||||
this.channelOverrides.set(channel.channel_id,
|
this.channelOverrides.set(channel.channel_id,
|
||||||
new ClientUserChannelOverride(this.client.user, channel));
|
new ClientUserChannelOverride(channel));
|
||||||
}
|
}
|
||||||
} else if (typeof value === 'function') {
|
} else if (typeof value === 'function') {
|
||||||
this[value.name] = value(data[key]);
|
this[value.name] = value(data[key]);
|
||||||
|
|
@ -24286,7 +24301,7 @@ class ClientUserGuildSettings {
|
||||||
* @returns {Promise<Object>}
|
* @returns {Promise<Object>}
|
||||||
*/
|
*/
|
||||||
update(name, value) {
|
update(name, value) {
|
||||||
return this.guild.client.api.guilds(this.guild.id).settings.patch({ data: { [name]: value } });
|
return this.client.api.users('@me').guilds(this.guildID).settings.patch({ data: { [name]: value } });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -24303,8 +24318,7 @@ const Constants = __webpack_require__(0);
|
||||||
* A wrapper around the ClientUser's channel overrides.
|
* A wrapper around the ClientUser's channel overrides.
|
||||||
*/
|
*/
|
||||||
class ClientUserChannelOverride {
|
class ClientUserChannelOverride {
|
||||||
constructor(user, data) {
|
constructor(data) {
|
||||||
this.user = user;
|
|
||||||
this.patch(data);
|
this.patch(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -24313,8 +24327,7 @@ class ClientUserChannelOverride {
|
||||||
* @param {Object} data Data to patch this with
|
* @param {Object} data Data to patch this with
|
||||||
*/
|
*/
|
||||||
patch(data) {
|
patch(data) {
|
||||||
for (const key of Object.keys(Constants.UserChannelOverrideMap)) {
|
for (const [key, value] of Object.entries(Constants.UserChannelOverrideMap)) {
|
||||||
const value = Constants.UserChannelOverrideMap[key];
|
|
||||||
if (!data.hasOwnProperty(key)) continue;
|
if (!data.hasOwnProperty(key)) continue;
|
||||||
if (typeof value === 'function') {
|
if (typeof value === 'function') {
|
||||||
this[value.name] = value(data[key]);
|
this[value.name] = value(data[key]);
|
||||||
|
|
|
||||||
2
discord.master.min.js
vendored
2
discord.master.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue