Pull.
J'ai juste update le cutie.js, CONNARD Ah oui, j'ai aussi add le info.js, qui est merdique d'ailleurs
This commit is contained in:
9
node_modules/discord.js/src/client/Client.js
generated
vendored
9
node_modules/discord.js/src/client/Client.js
generated
vendored
@@ -522,7 +522,7 @@ class Client extends BaseClient {
|
||||
}
|
||||
|
||||
/**
|
||||
* Calls {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval} on a script
|
||||
* Calls {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/eval} on a script
|
||||
* with the client as `this`.
|
||||
* @param {string} script Script to eval
|
||||
* @returns {*}
|
||||
@@ -604,7 +604,7 @@ module.exports = Client;
|
||||
*/
|
||||
|
||||
/**
|
||||
* A {@link https://developer.twitter.com/en/docs/twitter-ids Twitter snowflake},
|
||||
* A {@link https://docs.x.com/resources/fundamentals/x-ids Twitter snowflake},
|
||||
* except the epoch is 2015-01-01T00:00:00.000Z.
|
||||
*
|
||||
* If we have a snowflake '266241948824764416' we can represent it as binary:
|
||||
@@ -638,6 +638,11 @@ module.exports = Client;
|
||||
* @see {@link https://discord.js.org/docs/packages/rest/stable/ImageURLOptions:Interface}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @external EmojiURLOptions
|
||||
* @see {@link https://discord.js.org/docs/packages/rest/stable/EmojiURLOptions:TypeAlias}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @external BaseImageURLOptions
|
||||
* @see {@link https://discord.js.org/docs/packages/rest/stable/BaseImageURLOptions:Interface}
|
||||
|
||||
17
node_modules/discord.js/src/client/websocket/WebSocketManager.js
generated
vendored
17
node_modules/discord.js/src/client/websocket/WebSocketManager.js
generated
vendored
@@ -19,6 +19,7 @@ const Status = require('../../util/Status');
|
||||
const WebSocketShardEvents = require('../../util/WebSocketShardEvents');
|
||||
|
||||
let zlib;
|
||||
let deprecationEmitted = false;
|
||||
|
||||
try {
|
||||
zlib = require('zlib-sync');
|
||||
@@ -379,6 +380,22 @@ class WebSocketManager extends EventEmitter {
|
||||
/**
|
||||
* Emitted when the client becomes ready to start working.
|
||||
* @event Client#ready
|
||||
* @deprecated Use {@link Client#event:clientReady} instead.
|
||||
* @param {Client} client The client
|
||||
*/
|
||||
if (this.client.emit('ready', this.client) && !deprecationEmitted) {
|
||||
deprecationEmitted = true;
|
||||
|
||||
process.emitWarning(
|
||||
// eslint-disable-next-line max-len
|
||||
'The ready event has been renamed to clientReady to distinguish it from the gateway READY event and will only emit under that name in v15. Please use clientReady instead.',
|
||||
'DeprecationWarning',
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Emitted when the client becomes ready to start working.
|
||||
* @event Client#clientReady
|
||||
* @param {Client} client The client
|
||||
*/
|
||||
this.client.emit(Events.ClientReady, this.client);
|
||||
|
||||
1
node_modules/discord.js/src/index.js
generated
vendored
1
node_modules/discord.js/src/index.js
generated
vendored
@@ -126,6 +126,7 @@ exports.CommandInteractionOptionResolver = require('./structures/CommandInteract
|
||||
exports.Component = require('./structures/Component');
|
||||
exports.ContainerComponent = require('./structures/ContainerComponent');
|
||||
exports.ContextMenuCommandInteraction = require('./structures/ContextMenuCommandInteraction');
|
||||
exports.DirectoryChannel = require('./structures/DirectoryChannel');
|
||||
exports.DMChannel = require('./structures/DMChannel');
|
||||
exports.Embed = require('./structures/Embed');
|
||||
exports.EmbedBuilder = require('./structures/EmbedBuilder');
|
||||
|
||||
8
node_modules/discord.js/src/managers/GuildChannelManager.js
generated
vendored
8
node_modules/discord.js/src/managers/GuildChannelManager.js
generated
vendored
@@ -230,13 +230,13 @@ class GuildChannelManager extends CachedManager {
|
||||
async createWebhook({ channel, name, avatar, reason }) {
|
||||
const id = this.resolveId(channel);
|
||||
if (!id) throw new DiscordjsTypeError(ErrorCodes.InvalidType, 'channel', 'GuildChannelResolvable');
|
||||
if (typeof avatar === 'string' && !avatar.startsWith('data:')) {
|
||||
avatar = await resolveImage(avatar);
|
||||
}
|
||||
|
||||
const resolvedImage = await resolveImage(avatar);
|
||||
|
||||
const data = await this.client.rest.post(Routes.channelWebhooks(id), {
|
||||
body: {
|
||||
name,
|
||||
avatar,
|
||||
avatar: resolvedImage,
|
||||
},
|
||||
reason,
|
||||
});
|
||||
|
||||
2
node_modules/discord.js/src/managers/GuildMemberRoleManager.js
generated
vendored
2
node_modules/discord.js/src/managers/GuildMemberRoleManager.js
generated
vendored
@@ -65,7 +65,7 @@ class GuildMemberRoleManager extends DataManager {
|
||||
* @readonly
|
||||
*/
|
||||
get color() {
|
||||
const coloredRoles = this.cache.filter(role => role.color);
|
||||
const coloredRoles = this.cache.filter(role => role.colors.primaryColor);
|
||||
if (!coloredRoles.size) return null;
|
||||
return coloredRoles.reduce((prev, role) => (role.comparePositionTo(prev) > 0 ? role : prev));
|
||||
}
|
||||
|
||||
81
node_modules/discord.js/src/managers/MessageManager.js
generated
vendored
81
node_modules/discord.js/src/managers/MessageManager.js
generated
vendored
@@ -1,5 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
const process = require('node:process');
|
||||
const { Collection } = require('@discordjs/collection');
|
||||
const { makeURLSearchParams } = require('@discordjs/rest');
|
||||
const { Routes } = require('discord-api-types/v10');
|
||||
@@ -10,6 +11,8 @@ const MessagePayload = require('../structures/MessagePayload');
|
||||
const { MakeCacheOverrideSymbol } = require('../util/Symbols');
|
||||
const { resolvePartialEmoji } = require('../util/Util');
|
||||
|
||||
let deprecationEmittedForFetchPinned = false;
|
||||
|
||||
/**
|
||||
* Manages API methods for Messages and holds their cache.
|
||||
* @extends {CachedManager}
|
||||
@@ -116,19 +119,83 @@ class MessageManager extends CachedManager {
|
||||
return data.reduce((_data, message) => _data.set(message.id, this._add(message, options.cache)), new Collection());
|
||||
}
|
||||
|
||||
/**
|
||||
* Options used to fetch pinned messages.
|
||||
*
|
||||
* @typedef {Object} FetchPinnedMessagesOptions
|
||||
* @property {DateResolvable} [before] Consider only pinned messages before this time
|
||||
* @property {number} [limit] The maximum number of pinned messages to return
|
||||
* @property {boolean} [cache] Whether to cache the pinned messages
|
||||
*/
|
||||
|
||||
/**
|
||||
* Data returned from fetching pinned messages.
|
||||
*
|
||||
* @typedef {Object} FetchPinnedMessagesResponse
|
||||
* @property {MessagePin[]} items The pinned messages
|
||||
* @property {boolean} hasMore Whether there are additional pinned messages that require a subsequent call
|
||||
*/
|
||||
|
||||
/**
|
||||
* Pinned message data returned from fetching pinned messages.
|
||||
*
|
||||
* @typedef {Object} MessagePin
|
||||
* @property {Date} pinnedAt The time the message was pinned at
|
||||
* @property {number} pinnedTimestamp The timestamp the message was pinned at
|
||||
* @property {Message} message The pinned message
|
||||
*/
|
||||
|
||||
/**
|
||||
* Fetches the pinned messages of this channel and returns a collection of them.
|
||||
* <info>The returned Collection does not contain any reaction data of the messages.
|
||||
* Those need to be fetched separately.</info>
|
||||
*
|
||||
* @param {FetchPinnedMessagesOptions} [options={}] Options for fetching pinned messages
|
||||
* @returns {Promise<FetchPinnedMessagesResponse>}
|
||||
* @example
|
||||
* // Get pinned messages
|
||||
* channel.messages.fetchPins()
|
||||
* .then(messages => console.log(`Received ${messages.items.length} messages`))
|
||||
* .catch(console.error);
|
||||
*/
|
||||
async fetchPins(options = {}) {
|
||||
const data = await this.client.rest.get(Routes.channelMessagesPins(this.channel.id), {
|
||||
query: makeURLSearchParams({
|
||||
...options,
|
||||
before: options.before && new Date(options.before).toISOString(),
|
||||
}),
|
||||
});
|
||||
|
||||
return {
|
||||
items: data.items.map(item => ({
|
||||
pinnedTimestamp: Date.parse(item.pinned_at),
|
||||
get pinnedAt() {
|
||||
return new Date(this.pinnedTimestamp);
|
||||
},
|
||||
message: this._add(item.message, options.cache),
|
||||
})),
|
||||
hasMore: data.has_more,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the pinned messages of this channel and returns a collection of them.
|
||||
* <info>The returned Collection does not contain any reaction data of the messages.
|
||||
* Those need to be fetched separately.</info>
|
||||
* @param {boolean} [cache=true] Whether to cache the message(s)
|
||||
* @deprecated Use {@link MessageManager#fetchPins} instead.
|
||||
* @returns {Promise<Collection<Snowflake, Message>>}
|
||||
* @example
|
||||
* // Get pinned messages
|
||||
* channel.messages.fetchPinned()
|
||||
* .then(messages => console.log(`Received ${messages.size} messages`))
|
||||
* .catch(console.error);
|
||||
*/
|
||||
async fetchPinned(cache = true) {
|
||||
if (!deprecationEmittedForFetchPinned) {
|
||||
process.emitWarning(
|
||||
'The MessageManager#fetchPinned() method is deprecated. Use MessageManager#fetchPins() instead.',
|
||||
'DeprecationWarning',
|
||||
);
|
||||
|
||||
deprecationEmittedForFetchPinned = true;
|
||||
}
|
||||
|
||||
const data = await this.client.rest.get(Routes.channelPins(this.channel.id));
|
||||
const messages = new Collection();
|
||||
for (const message of data) messages.set(message.id, this._add(message, cache));
|
||||
@@ -219,7 +286,7 @@ class MessageManager extends CachedManager {
|
||||
message = this.resolveId(message);
|
||||
if (!message) throw new DiscordjsTypeError(ErrorCodes.InvalidType, 'message', 'MessageResolvable');
|
||||
|
||||
await this.client.rest.put(Routes.channelPin(this.channel.id, message), { reason });
|
||||
await this.client.rest.put(Routes.channelMessagesPin(this.channel.id, message), { reason });
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -232,7 +299,7 @@ class MessageManager extends CachedManager {
|
||||
message = this.resolveId(message);
|
||||
if (!message) throw new DiscordjsTypeError(ErrorCodes.InvalidType, 'message', 'MessageResolvable');
|
||||
|
||||
await this.client.rest.delete(Routes.channelPin(this.channel.id, message), { reason });
|
||||
await this.client.rest.delete(Routes.channelMessagesPin(this.channel.id, message), { reason });
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
82
node_modules/discord.js/src/managers/RoleManager.js
generated
vendored
82
node_modules/discord.js/src/managers/RoleManager.js
generated
vendored
@@ -12,6 +12,8 @@ const PermissionsBitField = require('../util/PermissionsBitField');
|
||||
const { setPosition, resolveColor } = require('../util/Util');
|
||||
|
||||
let cacheWarningEmitted = false;
|
||||
let deprecationEmittedForCreate = false;
|
||||
let deprecationEmittedForEdit = false;
|
||||
|
||||
/**
|
||||
* Manages API methods for roles and stores their cache.
|
||||
@@ -58,7 +60,7 @@ class RoleManager extends CachedManager {
|
||||
* @example
|
||||
* // Fetch a single role
|
||||
* message.guild.roles.fetch('222078108977594368')
|
||||
* .then(role => console.log(`The role color is: ${role.color}`))
|
||||
* .then(role => console.log(`The role color is: ${role.colors.primaryColor}`))
|
||||
* .catch(console.error);
|
||||
*/
|
||||
async fetch(id, { cache = true, force = false } = {}) {
|
||||
@@ -112,11 +114,24 @@ class RoleManager extends CachedManager {
|
||||
* @returns {?Snowflake}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {Object} RoleColorsResolvable
|
||||
* @property {ColorResolvable} primaryColor The primary color of the role
|
||||
* @property {ColorResolvable} [secondaryColor] The secondary color of the role.
|
||||
* This will make the role a gradient between the other provided colors
|
||||
* @property {ColorResolvable} [tertiaryColor] The tertiary color of the role.
|
||||
* When sending `tertiaryColor` the API enforces the role color to be a holographic style
|
||||
* with values of `primaryColor = 11127295`, `secondaryColor = 16759788`, and `tertiaryColor = 16761760`.
|
||||
* These values are available as a constant: `Constants.HolographicStyle`
|
||||
*/
|
||||
|
||||
/**
|
||||
* Options used to create a new role.
|
||||
* @typedef {Object} RoleCreateOptions
|
||||
* @property {string} [name] The name of the new role
|
||||
* @property {ColorResolvable} [color] The data to create the role with
|
||||
* <warn>This property is deprecated. Use `colors` instead.</warn>
|
||||
* @property {RoleColorsResolvable} [colors] The colors to create the role with
|
||||
* @property {boolean} [hoist] Whether or not the new role should be hoisted
|
||||
* @property {PermissionResolvable} [permissions] The permissions for the new role
|
||||
* @property {number} [position] The position of the new role
|
||||
@@ -142,15 +157,30 @@ class RoleManager extends CachedManager {
|
||||
* // Create a new role with data and a reason
|
||||
* guild.roles.create({
|
||||
* name: 'Super Cool Blue People',
|
||||
* color: Colors.Blue,
|
||||
* reason: 'we needed a role for Super Cool People',
|
||||
* colors: {
|
||||
* primaryColor: Colors.Blue,
|
||||
* },
|
||||
* })
|
||||
* .then(console.log)
|
||||
* .catch(console.error);
|
||||
* @example
|
||||
* // Create a role with holographic colors
|
||||
* guild.roles.create({
|
||||
* name: 'Holographic Role',
|
||||
* reason: 'Creating a role with holographic effect',
|
||||
* colors: {
|
||||
* primaryColor: Constants.HolographicStyle.Primary,
|
||||
* secondaryColor: Constants.HolographicStyle.Secondary,
|
||||
* tertiaryColor: Constants.HolographicStyle.Tertiary,
|
||||
* },
|
||||
* })
|
||||
* .then(console.log)
|
||||
* .catch(console.error);
|
||||
*/
|
||||
async create(options = {}) {
|
||||
let { name, color, hoist, permissions, position, mentionable, reason, icon, unicodeEmoji } = options;
|
||||
color &&= resolveColor(color);
|
||||
let { permissions, icon } = options;
|
||||
const { name, color, hoist, position, mentionable, reason, unicodeEmoji } = options;
|
||||
if (permissions !== undefined) permissions = new PermissionsBitField(permissions);
|
||||
if (icon) {
|
||||
const guildEmojiURL = this.guild.emojis.resolve(icon)?.imageURL();
|
||||
@@ -158,10 +188,30 @@ class RoleManager extends CachedManager {
|
||||
if (typeof icon !== 'string') icon = undefined;
|
||||
}
|
||||
|
||||
let colors = options.colors && {
|
||||
primary_color: resolveColor(options.colors.primaryColor),
|
||||
secondary_color: options.colors.secondaryColor && resolveColor(options.colors.secondaryColor),
|
||||
tertiary_color: options.colors.tertiaryColor && resolveColor(options.colors.tertiaryColor),
|
||||
};
|
||||
|
||||
if (color !== undefined) {
|
||||
if (!deprecationEmittedForCreate) {
|
||||
process.emitWarning(`Passing "color" to RoleManager#create() is deprecated. Use "colors" instead.`);
|
||||
}
|
||||
|
||||
deprecationEmittedForCreate = true;
|
||||
|
||||
colors = {
|
||||
primary_color: resolveColor(color),
|
||||
secondary_color: null,
|
||||
tertiary_color: null,
|
||||
};
|
||||
}
|
||||
|
||||
const data = await this.client.rest.post(Routes.guildRoles(this.guild.id), {
|
||||
body: {
|
||||
name,
|
||||
color,
|
||||
colors,
|
||||
hoist,
|
||||
permissions,
|
||||
mentionable,
|
||||
@@ -210,9 +260,29 @@ class RoleManager extends CachedManager {
|
||||
if (typeof icon !== 'string') icon = undefined;
|
||||
}
|
||||
|
||||
let colors = options.colors && {
|
||||
primary_color: resolveColor(options.colors.primaryColor),
|
||||
secondary_color: options.colors.secondaryColor && resolveColor(options.colors.secondaryColor),
|
||||
tertiary_color: options.colors.tertiaryColor && resolveColor(options.colors.tertiaryColor),
|
||||
};
|
||||
|
||||
if (options.color !== undefined) {
|
||||
if (!deprecationEmittedForEdit) {
|
||||
process.emitWarning(`Passing "color" to RoleManager#edit() is deprecated. Use "colors" instead.`);
|
||||
}
|
||||
|
||||
deprecationEmittedForEdit = true;
|
||||
|
||||
colors = {
|
||||
primary_color: resolveColor(options.color),
|
||||
secondary_color: null,
|
||||
tertiary_color: null,
|
||||
};
|
||||
}
|
||||
|
||||
const body = {
|
||||
name: options.name,
|
||||
color: options.color === undefined ? undefined : resolveColor(options.color),
|
||||
colors,
|
||||
hoist: options.hoist,
|
||||
permissions: options.permissions === undefined ? undefined : new PermissionsBitField(options.permissions),
|
||||
mentionable: options.mentionable,
|
||||
|
||||
2
node_modules/discord.js/src/structures/ApplicationCommand.js
generated
vendored
2
node_modules/discord.js/src/structures/ApplicationCommand.js
generated
vendored
@@ -312,7 +312,7 @@ class ApplicationCommand extends Base {
|
||||
* @returns {Promise<ApplicationCommand>}
|
||||
* @example
|
||||
* // Edit the name localizations of this command
|
||||
* command.setLocalizedNames({
|
||||
* command.setNameLocalizations({
|
||||
* 'en-GB': 'test',
|
||||
* 'pt-BR': 'teste',
|
||||
* })
|
||||
|
||||
81
node_modules/discord.js/src/structures/ApplicationEmoji.js
generated
vendored
81
node_modules/discord.js/src/structures/ApplicationEmoji.js
generated
vendored
@@ -16,37 +16,42 @@ class ApplicationEmoji extends Emoji {
|
||||
*/
|
||||
this.application = application;
|
||||
|
||||
/**
|
||||
* The user who created this emoji
|
||||
* @type {?User}
|
||||
*/
|
||||
this.author = null;
|
||||
|
||||
this.managed = null;
|
||||
this.requiresColons = null;
|
||||
|
||||
this._patch(data);
|
||||
}
|
||||
|
||||
_patch(data) {
|
||||
if ('name' in data) this.name = data.name;
|
||||
if (data.user) this.author = this.client.users._add(data.user);
|
||||
if (data.user) {
|
||||
/**
|
||||
* The user who created this emoji
|
||||
* @type {User}
|
||||
*/
|
||||
this.author = this.client.users._add(data.user);
|
||||
}
|
||||
|
||||
if ('managed' in data) {
|
||||
/**
|
||||
* Whether this emoji is managed by an external service
|
||||
* @type {?boolean}
|
||||
* Whether this emoji is managed by an external service. Always `false` for application emojis
|
||||
* @type {false}
|
||||
*/
|
||||
this.managed = data.managed;
|
||||
}
|
||||
|
||||
if ('require_colons' in data) {
|
||||
/**
|
||||
* Whether or not this emoji requires colons surrounding it
|
||||
* @type {?boolean}
|
||||
* Whether this emoji requires colons surrounding it. Always `true` for application emojis
|
||||
* @type {true}
|
||||
*/
|
||||
this.requiresColons = data.require_colons;
|
||||
}
|
||||
|
||||
if ('available' in data) {
|
||||
/**
|
||||
* Whether this emoji is available. Always `true` for application emojis
|
||||
* @type {true}
|
||||
*/
|
||||
this.available = data.available;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -107,7 +112,8 @@ class ApplicationEmoji extends Emoji {
|
||||
other.id === this.id &&
|
||||
other.name === this.name &&
|
||||
other.managed === this.managed &&
|
||||
other.requiresColons === this.requiresColons
|
||||
other.requiresColons === this.requiresColons &&
|
||||
other.available === this.available
|
||||
);
|
||||
}
|
||||
|
||||
@@ -115,4 +121,49 @@ class ApplicationEmoji extends Emoji {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The emoji's name
|
||||
* @name name
|
||||
* @memberof ApplicationEmoji
|
||||
* @instance
|
||||
* @type {string}
|
||||
* @readonly
|
||||
*/
|
||||
|
||||
/**
|
||||
* Whether the emoji is animated
|
||||
* @name animated
|
||||
* @memberof ApplicationEmoji
|
||||
* @instance
|
||||
* @type {boolean}
|
||||
* @readonly
|
||||
*/
|
||||
|
||||
/**
|
||||
* Returns a URL for the emoji.
|
||||
* @method imageURL
|
||||
* @memberof ApplicationEmoji
|
||||
* @instance
|
||||
* @param {EmojiURLOptions} [options] Options for the image URL
|
||||
* @returns {string}
|
||||
*/
|
||||
|
||||
/**
|
||||
* The time the emoji was created at
|
||||
* @name createdAt
|
||||
* @memberof ApplicationEmoji
|
||||
* @instance
|
||||
* @type {Date}
|
||||
* @readonly
|
||||
*/
|
||||
|
||||
/**
|
||||
* The timestamp the emoji was created at
|
||||
* @name createdTimestamp
|
||||
* @memberof ApplicationEmoji
|
||||
* @instance
|
||||
* @type {number}
|
||||
* @readonly
|
||||
*/
|
||||
|
||||
module.exports = ApplicationEmoji;
|
||||
|
||||
38
node_modules/discord.js/src/structures/BaseGuildEmoji.js
generated
vendored
38
node_modules/discord.js/src/structures/BaseGuildEmoji.js
generated
vendored
@@ -58,7 +58,7 @@ class BaseGuildEmoji extends Emoji {
|
||||
* @method imageURL
|
||||
* @memberof BaseGuildEmoji
|
||||
* @instance
|
||||
* @param {BaseImageURLOptions} [options] Options for the image URL
|
||||
* @param {EmojiURLOptions} [options] Options for the emoji URL
|
||||
* @returns {string}
|
||||
*/
|
||||
|
||||
@@ -72,4 +72,40 @@ class BaseGuildEmoji extends Emoji {
|
||||
* @deprecated Use {@link BaseGuildEmoji#imageURL} instead.
|
||||
*/
|
||||
|
||||
/**
|
||||
* The emoji's name
|
||||
* @name name
|
||||
* @memberof BaseGuildEmoji
|
||||
* @instance
|
||||
* @type {string}
|
||||
* @readonly
|
||||
*/
|
||||
|
||||
/**
|
||||
* Whether or not the emoji is animated
|
||||
* @name animated
|
||||
* @memberof BaseGuildEmoji
|
||||
* @instance
|
||||
* @type {boolean}
|
||||
* @readonly
|
||||
*/
|
||||
|
||||
/**
|
||||
* The time the emoji was created at.
|
||||
* @name createdAt
|
||||
* @memberof BaseGuildEmoji
|
||||
* @instance
|
||||
* @type {Date}
|
||||
* @readonly
|
||||
*/
|
||||
|
||||
/**
|
||||
* The timestamp the emoji was created at.
|
||||
* @name createdTimestamp
|
||||
* @memberof BaseGuildEmoji
|
||||
* @instance
|
||||
* @type {number}
|
||||
* @readonly
|
||||
*/
|
||||
|
||||
module.exports = BaseGuildEmoji;
|
||||
|
||||
2
node_modules/discord.js/src/structures/Emoji.js
generated
vendored
2
node_modules/discord.js/src/structures/Emoji.js
generated
vendored
@@ -45,7 +45,7 @@ class Emoji extends Base {
|
||||
|
||||
/**
|
||||
* Returns a URL for the emoji or `null` if this is not a custom emoji.
|
||||
* @param {BaseImageURLOptions} [options] Options for the image URL
|
||||
* @param {EmojiURLOptions} [options] Options for the emoji URL
|
||||
* @returns {?string}
|
||||
*/
|
||||
imageURL(options) {
|
||||
|
||||
3
node_modules/discord.js/src/structures/GuildChannel.js
generated
vendored
3
node_modules/discord.js/src/structures/GuildChannel.js
generated
vendored
@@ -250,10 +250,11 @@ class GuildChannel extends BaseChannel {
|
||||
return new PermissionsBitField(PermissionsBitField.All).freeze();
|
||||
}
|
||||
|
||||
const basePermissions = new PermissionsBitField([role.permissions, role.guild.roles.everyone.permissions]);
|
||||
const everyoneOverwrites = this.permissionOverwrites.cache.get(this.guild.id);
|
||||
const roleOverwrites = this.permissionOverwrites.cache.get(role.id);
|
||||
|
||||
return role.permissions
|
||||
return basePermissions
|
||||
.remove(everyoneOverwrites?.deny ?? PermissionsBitField.DefaultBit)
|
||||
.add(everyoneOverwrites?.allow ?? PermissionsBitField.DefaultBit)
|
||||
.remove(roleOverwrites?.deny ?? PermissionsBitField.DefaultBit)
|
||||
|
||||
2
node_modules/discord.js/src/structures/GuildMember.js
generated
vendored
2
node_modules/discord.js/src/structures/GuildMember.js
generated
vendored
@@ -270,7 +270,7 @@ class GuildMember extends Base {
|
||||
* @readonly
|
||||
*/
|
||||
get displayColor() {
|
||||
return this.roles.color?.color ?? 0;
|
||||
return this.roles.color?.colors.primaryColor ?? 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
1
node_modules/discord.js/src/structures/Message.js
generated
vendored
1
node_modules/discord.js/src/structures/Message.js
generated
vendored
@@ -812,6 +812,7 @@ class Message extends Base {
|
||||
return Boolean(
|
||||
channel?.type === ChannelType.GuildAnnouncement &&
|
||||
!this.flags.has(MessageFlags.Crossposted) &&
|
||||
this.reference?.type !== MessageReferenceType.Forward &&
|
||||
this.type === MessageType.Default &&
|
||||
!this.poll &&
|
||||
channel.viewable &&
|
||||
|
||||
66
node_modules/discord.js/src/structures/Role.js
generated
vendored
66
node_modules/discord.js/src/structures/Role.js
generated
vendored
@@ -54,11 +54,37 @@ class Role extends Base {
|
||||
if ('color' in data) {
|
||||
/**
|
||||
* The base 10 color of the role
|
||||
*
|
||||
* @type {number}
|
||||
* @deprecated Use {@link Role#colors} instead.
|
||||
*/
|
||||
this.color = data.color;
|
||||
}
|
||||
|
||||
/**
|
||||
* @typedef {Object} RoleColors
|
||||
* @property {number} primaryColor The primary color of the role
|
||||
* @property {?number} secondaryColor The secondary color of the role.
|
||||
* This will make the role a gradient between the other provided colors
|
||||
* @property {?number} tertiaryColor The tertiary color of the role.
|
||||
* When sending `tertiaryColor` the API enforces the role color to be a holographic style
|
||||
* with values of `primaryColor = 11127295`, `secondaryColor = 16759788`, and `tertiaryColor = 16761760`.
|
||||
* These values are available as a constant: `Constants.HolographicStyle`
|
||||
*/
|
||||
|
||||
if ('colors' in data) {
|
||||
/**
|
||||
* The colors of the role
|
||||
*
|
||||
* @type {RoleColors}
|
||||
*/
|
||||
this.colors = {
|
||||
primaryColor: data.colors.primary_color,
|
||||
secondaryColor: data.colors.secondary_color,
|
||||
tertiaryColor: data.colors.tertiary_color,
|
||||
};
|
||||
}
|
||||
|
||||
if ('hoist' in data) {
|
||||
/**
|
||||
* If true, users that are part of this role will appear in a separate category in the users list
|
||||
@@ -170,7 +196,7 @@ class Role extends Base {
|
||||
* @readonly
|
||||
*/
|
||||
get hexColor() {
|
||||
return `#${this.color.toString(16).padStart(6, '0')}`;
|
||||
return `#${this.colors.primaryColor.toString(16).padStart(6, '0')}`;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -231,6 +257,8 @@ class Role extends Base {
|
||||
* @typedef {Object} RoleData
|
||||
* @property {string} [name] The name of the role
|
||||
* @property {ColorResolvable} [color] The color of the role, either a hex string or a base 10 number
|
||||
* <warn>This property is deprecated. Use `colors` instead.</warn>
|
||||
* @property {RoleColorsResolvable} [colors] The colors of the role
|
||||
* @property {boolean} [hoist] Whether or not the role should be hoisted
|
||||
* @property {number} [position] The position of the role
|
||||
* @property {PermissionResolvable} [permissions] The permissions of the role
|
||||
@@ -286,17 +314,39 @@ class Role extends Base {
|
||||
|
||||
/**
|
||||
* Sets a new color for the role.
|
||||
*
|
||||
* @param {ColorResolvable} color The color of the role
|
||||
* @param {string} [reason] Reason for changing the role's color
|
||||
* @returns {Promise<Role>}
|
||||
* @deprecated Use {@link Role#setColors} instead.
|
||||
*/
|
||||
async setColor(color, reason) {
|
||||
return this.edit({ color, reason });
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets new colors for the role.
|
||||
*
|
||||
* @param {RoleColorsResolvable} colors The colors of the role
|
||||
* @param {string} [reason] Reason for changing the role's colors
|
||||
* @returns {Promise<Role>}
|
||||
* @example
|
||||
* // Set the color of a role
|
||||
* role.setColor('#FF0000')
|
||||
* .then(updated => console.log(`Set color of role to ${updated.color}`))
|
||||
* // Set the colors of a role
|
||||
* role.setColors({ primaryColor: '#FF0000', secondaryColor: '#00FF00', tertiaryColor: '#0000FF' })
|
||||
* .then(updated => console.log(`Set colors of role to ${updated.colors}`))
|
||||
* .catch(console.error);
|
||||
* @example
|
||||
* // Set holographic colors using constants
|
||||
* role.setColors({
|
||||
* primaryColor: Constants.HolographicStyle.Primary,
|
||||
* secondaryColor: Constants.HolographicStyle.Secondary,
|
||||
* tertiaryColor: Constants.HolographicStyle.Tertiary,
|
||||
* })
|
||||
* .then(updated => console.log(`Set holographic colors for role ${updated.name}`))
|
||||
* .catch(console.error);
|
||||
*/
|
||||
setColor(color, reason) {
|
||||
return this.edit({ color, reason });
|
||||
async setColors(colors, reason) {
|
||||
return this.edit({ colors, reason });
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -434,7 +484,9 @@ class Role extends Base {
|
||||
role &&
|
||||
this.id === role.id &&
|
||||
this.name === role.name &&
|
||||
this.color === role.color &&
|
||||
this.colors.primaryColor === role.colors.primaryColor &&
|
||||
this.colors.secondaryColor === role.colors.secondaryColor &&
|
||||
this.colors.tertiaryColor === role.colors.tertiaryColor &&
|
||||
this.hoist === role.hoist &&
|
||||
this.position === role.position &&
|
||||
this.permissions.bitfield === role.permissions.bitfield &&
|
||||
|
||||
2
node_modules/discord.js/src/structures/ThreadChannel.js
generated
vendored
2
node_modules/discord.js/src/structures/ThreadChannel.js
generated
vendored
@@ -351,7 +351,7 @@ class ThreadChannel extends BaseChannel {
|
||||
async edit(options) {
|
||||
const newData = await this.client.rest.patch(Routes.channel(this.id), {
|
||||
body: {
|
||||
name: (options.name ?? this.name).trim(),
|
||||
name: options.name,
|
||||
archived: options.archived,
|
||||
auto_archive_duration: options.autoArchiveDuration,
|
||||
rate_limit_per_user: options.rateLimitPerUser,
|
||||
|
||||
114
node_modules/discord.js/src/structures/User.js
generated
vendored
114
node_modules/discord.js/src/structures/User.js
generated
vendored
@@ -5,6 +5,7 @@ const { calculateUserDefaultAvatarIndex } = require('@discordjs/rest');
|
||||
const { DiscordSnowflake } = require('@sapphire/snowflake');
|
||||
const Base = require('./Base');
|
||||
const TextBasedChannel = require('./interfaces/TextBasedChannel');
|
||||
const { _transformCollectibles } = require('../util/Transformers.js');
|
||||
const UserFlagsBitField = require('../util/UserFlagsBitField');
|
||||
const { emitDeprecationWarningForUserFetchFlags } = require('../util/Util');
|
||||
|
||||
@@ -140,18 +141,74 @@ class User extends Base {
|
||||
* @property {string} asset The avatar decoration hash
|
||||
* @property {Snowflake} skuId The id of the avatar decoration's SKU
|
||||
*/
|
||||
|
||||
if (data.avatar_decoration_data) {
|
||||
/**
|
||||
* The user avatar decoration's data
|
||||
* @type {?AvatarDecorationData}
|
||||
*/
|
||||
this.avatarDecorationData = {
|
||||
asset: data.avatar_decoration_data.asset,
|
||||
skuId: data.avatar_decoration_data.sku_id,
|
||||
};
|
||||
if ('avatar_decoration_data' in data) {
|
||||
if (data.avatar_decoration_data) {
|
||||
/**
|
||||
* The user avatar decoration's data
|
||||
*
|
||||
* @type {?AvatarDecorationData}
|
||||
*/
|
||||
this.avatarDecorationData = {
|
||||
asset: data.avatar_decoration_data.asset,
|
||||
skuId: data.avatar_decoration_data.sku_id,
|
||||
};
|
||||
} else {
|
||||
this.avatarDecorationData = null;
|
||||
}
|
||||
} else {
|
||||
this.avatarDecorationData = null;
|
||||
this.avatarDecorationData ??= null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @typedef {Object} NameplateData
|
||||
* @property {Snowflake} skuId The id of the nameplate's SKU
|
||||
* @property {string} asset The nameplate's asset path
|
||||
* @property {string} label The nameplate's label
|
||||
* @property {NameplatePalette} palette Background color of the nameplate
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {Object} Collectibles
|
||||
* @property {?NameplateData} nameplate The user's nameplate data
|
||||
*/
|
||||
|
||||
if (data.collectibles) {
|
||||
/**
|
||||
* The user's collectibles
|
||||
*
|
||||
* @type {?Collectibles}
|
||||
*/
|
||||
this.collectibles = _transformCollectibles(data.collectibles);
|
||||
} else {
|
||||
this.collectibles = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @typedef {Object} UserPrimaryGuild
|
||||
* @property {?Snowflake} identityGuildId The id of the user's primary guild
|
||||
* @property {?boolean} identityEnabled Whether the user is displaying the primary guild's tag
|
||||
* @property {?string} tag The user's guild tag. Limited to 4 characters
|
||||
* @property {?string} badge The guild tag badge hash
|
||||
*/
|
||||
|
||||
if ('primary_guild' in data) {
|
||||
if (data.primary_guild) {
|
||||
/**
|
||||
* The primary guild of the user
|
||||
*
|
||||
* @type {?UserPrimaryGuild}
|
||||
*/
|
||||
this.primaryGuild = {
|
||||
identityGuildId: data.primary_guild.identity_guild_id,
|
||||
identityEnabled: data.primary_guild.identity_enabled,
|
||||
tag: data.primary_guild.tag,
|
||||
badge: data.primary_guild.badge,
|
||||
};
|
||||
} else {
|
||||
this.primaryGuild = null;
|
||||
}
|
||||
} else {
|
||||
this.primaryGuild ??= null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -244,6 +301,18 @@ class User extends Base {
|
||||
return this.banner && this.client.rest.cdn.banner(this.id, this.banner, options);
|
||||
}
|
||||
|
||||
/**
|
||||
* A link to the user's guild tag badge.
|
||||
*
|
||||
* @param {ImageURLOptions} [options={}] Options for the image URL
|
||||
* @returns {?string}
|
||||
*/
|
||||
guildTagBadgeURL(options = {}) {
|
||||
return this.primaryGuild?.badge
|
||||
? this.client.rest.cdn.guildTagBadge(this.primaryGuild.identityGuildId, this.primaryGuild.badge, options)
|
||||
: null;
|
||||
}
|
||||
|
||||
/**
|
||||
* The tag of this user
|
||||
* <info>This user's username, or their legacy tag (e.g. `hydrabolt#0001`)
|
||||
@@ -314,7 +383,15 @@ class User extends Base {
|
||||
this.accentColor === user.accentColor &&
|
||||
this.avatarDecoration === user.avatarDecoration &&
|
||||
this.avatarDecorationData?.asset === user.avatarDecorationData?.asset &&
|
||||
this.avatarDecorationData?.skuId === user.avatarDecorationData?.skuId
|
||||
this.avatarDecorationData?.skuId === user.avatarDecorationData?.skuId &&
|
||||
this.collectibles?.nameplate?.skuId === user.collectibles?.nameplate?.skuId &&
|
||||
this.collectibles?.nameplate?.asset === user.collectibles?.nameplate?.asset &&
|
||||
this.collectibles?.nameplate?.label === user.collectibles?.nameplate?.label &&
|
||||
this.collectibles?.nameplate?.palette === user.collectibles?.nameplate?.palette &&
|
||||
this.primaryGuild?.identityGuildId === user.primaryGuild?.identityGuildId &&
|
||||
this.primaryGuild?.identityEnabled === user.primaryGuild?.identityEnabled &&
|
||||
this.primaryGuild?.tag === user.primaryGuild?.tag &&
|
||||
this.primaryGuild?.badge === user.primaryGuild?.badge
|
||||
);
|
||||
}
|
||||
|
||||
@@ -339,6 +416,18 @@ class User extends Base {
|
||||
('avatar_decoration_data' in user
|
||||
? this.avatarDecorationData?.asset === user.avatar_decoration_data?.asset &&
|
||||
this.avatarDecorationData?.skuId === user.avatar_decoration_data?.sku_id
|
||||
: true) &&
|
||||
('collectibles' in user
|
||||
? this.collectibles?.nameplate?.skuId === user.collectibles?.nameplate?.sku_id &&
|
||||
this.collectibles?.nameplate?.asset === user.collectibles?.nameplate?.asset &&
|
||||
this.collectibles?.nameplate?.label === user.collectibles?.nameplate?.label &&
|
||||
this.collectibles?.nameplate?.palette === user.collectibles?.nameplate?.palette
|
||||
: true) &&
|
||||
('primary_guild' in user
|
||||
? this.primaryGuild?.identityGuildId === user.primary_guild?.identity_guild_id &&
|
||||
this.primaryGuild?.identityEnabled === user.primary_guild?.identity_enabled &&
|
||||
this.primaryGuild?.tag === user.primary_guild?.tag &&
|
||||
this.primaryGuild?.badge === user.primary_guild?.badge
|
||||
: true)
|
||||
);
|
||||
}
|
||||
@@ -388,6 +477,7 @@ class User extends Base {
|
||||
json.avatarURL = this.avatarURL();
|
||||
json.displayAvatarURL = this.displayAvatarURL();
|
||||
json.bannerURL = this.banner ? this.bannerURL() : this.banner;
|
||||
json.guildTagBadgeURL = this.guildTagBadgeURL();
|
||||
return json;
|
||||
}
|
||||
}
|
||||
|
||||
2
node_modules/discord.js/src/structures/interfaces/Collector.js
generated
vendored
2
node_modules/discord.js/src/structures/interfaces/Collector.js
generated
vendored
@@ -267,7 +267,7 @@ class Collector extends EventEmitter {
|
||||
|
||||
/**
|
||||
* Allows collectors to be consumed with for-await-of loops
|
||||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of}
|
||||
* @see {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for-await...of}
|
||||
*/
|
||||
async *[Symbol.asyncIterator]() {
|
||||
const queue = [];
|
||||
|
||||
5
node_modules/discord.js/src/util/APITypes.js
generated
vendored
5
node_modules/discord.js/src/util/APITypes.js
generated
vendored
@@ -550,6 +550,11 @@
|
||||
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/MessageFlags}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @external NameplatePalette
|
||||
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/NameplatePalette}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @external OAuth2Scopes
|
||||
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/OAuth2Scopes}
|
||||
|
||||
16
node_modules/discord.js/src/util/Constants.js
generated
vendored
16
node_modules/discord.js/src/util/Constants.js
generated
vendored
@@ -254,6 +254,21 @@ exports.StickerFormatExtensionMap = {
|
||||
[StickerFormatType.GIF]: ImageFormat.GIF,
|
||||
};
|
||||
|
||||
/**
|
||||
* Holographic color values for role styling.
|
||||
* When using `tertiaryColor`, the API enforces these specific values for holographic effect.
|
||||
*
|
||||
* @typedef {Object} HolographicStyle
|
||||
* @property {number} Primary 11127295 (0xA9FFFF)
|
||||
* @property {number} Secondary 16759788 (0xFFCCCC)
|
||||
* @property {number} Tertiary 16761760 (0xFFE0A0)
|
||||
*/
|
||||
exports.HolographicStyle = {
|
||||
Primary: 11_127_295,
|
||||
Secondary: 16_759_788,
|
||||
Tertiary: 16_761_760,
|
||||
};
|
||||
|
||||
/**
|
||||
* @typedef {Object} Constants Constants that can be used in an enum or object-like way.
|
||||
* @property {number} MaxBulkDeletableMessageAge Max bulk deletable message age
|
||||
@@ -264,4 +279,5 @@ exports.StickerFormatExtensionMap = {
|
||||
* @property {VoiceBasedChannelTypes} VoiceBasedChannelTypes The types of channels that are voice-based
|
||||
* @property {SelectMenuTypes} SelectMenuTypes The types of components that are select menus.
|
||||
* @property {Object} StickerFormatExtensionMap A mapping between sticker formats and their respective image formats.
|
||||
* @property {HolographicStyle} HolographicStyle Holographic color values for role styling.
|
||||
*/
|
||||
|
||||
8
node_modules/discord.js/src/util/Events.js
generated
vendored
8
node_modules/discord.js/src/util/Events.js
generated
vendored
@@ -12,7 +12,7 @@
|
||||
* @property {string} ChannelDelete channelDelete
|
||||
* @property {string} ChannelPinsUpdate channelPinsUpdate
|
||||
* @property {string} ChannelUpdate channelUpdate
|
||||
* @property {string} ClientReady ready
|
||||
* @property {string} ClientReady clientReady
|
||||
* @property {string} Debug debug
|
||||
* @property {string} EntitlementCreate entitlementCreate
|
||||
* @property {string} EntitlementUpdate entitlementUpdate
|
||||
@@ -89,7 +89,7 @@
|
||||
* @property {string} VoiceServerUpdate voiceServerUpdate
|
||||
* @property {string} VoiceStateUpdate voiceStateUpdate
|
||||
* @property {string} Warn warn
|
||||
* @property {string} WebhooksUpdate webhookUpdate
|
||||
* @property {string} WebhooksUpdate webhooksUpdate
|
||||
*/
|
||||
|
||||
// JSDoc for IntelliSense purposes
|
||||
@@ -108,7 +108,7 @@ module.exports = {
|
||||
ChannelDelete: 'channelDelete',
|
||||
ChannelPinsUpdate: 'channelPinsUpdate',
|
||||
ChannelUpdate: 'channelUpdate',
|
||||
ClientReady: 'ready',
|
||||
ClientReady: 'clientReady',
|
||||
Debug: 'debug',
|
||||
EntitlementCreate: 'entitlementCreate',
|
||||
EntitlementUpdate: 'entitlementUpdate',
|
||||
@@ -186,5 +186,5 @@ module.exports = {
|
||||
VoiceServerUpdate: 'voiceServerUpdate',
|
||||
VoiceStateUpdate: 'voiceStateUpdate',
|
||||
Warn: 'warn',
|
||||
WebhooksUpdate: 'webhookUpdate',
|
||||
WebhooksUpdate: 'webhooksUpdate',
|
||||
};
|
||||
|
||||
21
node_modules/discord.js/src/util/Transformers.js
generated
vendored
21
node_modules/discord.js/src/util/Transformers.js
generated
vendored
@@ -95,10 +95,31 @@ function _transformAPIIncidentsData(data) {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Transforms a collectibles object to a camel-cased variant.
|
||||
*
|
||||
* @param {APICollectibles} collectibles The collectibles to transform
|
||||
* @returns {Collectibles}
|
||||
* @ignore
|
||||
*/
|
||||
function _transformCollectibles(collectibles) {
|
||||
if (!collectibles.nameplate) return { nameplate: null };
|
||||
|
||||
return {
|
||||
nameplate: {
|
||||
skuId: collectibles.nameplate.sku_id,
|
||||
asset: collectibles.nameplate.asset,
|
||||
label: collectibles.nameplate.label,
|
||||
palette: collectibles.nameplate.palette,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
toSnakeCase,
|
||||
_transformAPIAutoModerationAction,
|
||||
_transformAPIMessageInteractionMetadata,
|
||||
_transformGuildScheduledEventRecurrenceRule,
|
||||
_transformAPIIncidentsData,
|
||||
_transformCollectibles,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user