mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 01:23:31 +01:00
fix: Miscellaneous fixes (#9445)
Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com> Co-authored-by: Almeida <almeidx@pm.me> Co-authored-by: kyranet <kyradiscord@gmail.com> Fix embeds and components (#9437) fix links and invalid syntax (#9322)
This commit is contained in:
@@ -7,6 +7,19 @@ const GuildChannel = require('./GuildChannel');
|
||||
* @extends {GuildChannel}
|
||||
*/
|
||||
class CategoryChannel extends GuildChannel {
|
||||
/**
|
||||
* The id of the parent of this channel.
|
||||
* @name CategoryChannel#parentId
|
||||
* @type {null}
|
||||
*/
|
||||
|
||||
/**
|
||||
* The parent of this channel.
|
||||
* @name CategoryChannel#parent
|
||||
* @type {null}
|
||||
* @readonly
|
||||
*/
|
||||
|
||||
/**
|
||||
* Channels that are a part of this category
|
||||
* @type {Collection<Snowflake, GuildChannel>}
|
||||
@@ -18,7 +31,7 @@ class CategoryChannel extends GuildChannel {
|
||||
|
||||
/**
|
||||
* Sets the category parent of this channel.
|
||||
* <warn>It is not currently possible to set the parent of a CategoryChannel.</warn>
|
||||
* <warn>It is not possible to set the parent of a CategoryChannel.</warn>
|
||||
* @method setParent
|
||||
* @memberof CategoryChannel
|
||||
* @instance
|
||||
|
||||
@@ -186,7 +186,7 @@ class Channel extends Base {
|
||||
return this.type === 'GUILD_DIRECTORY';
|
||||
}
|
||||
|
||||
static create(client, data, guild, { allowUnknownGuild, fromInteraction } = {}) {
|
||||
static create(client, data, guild, { allowUnknownGuild } = {}) {
|
||||
CategoryChannel ??= require('./CategoryChannel');
|
||||
DMChannel ??= require('./DMChannel');
|
||||
NewsChannel ??= require('./NewsChannel');
|
||||
@@ -238,7 +238,7 @@ class Channel extends Base {
|
||||
case ChannelTypes.GUILD_NEWS_THREAD:
|
||||
case ChannelTypes.GUILD_PUBLIC_THREAD:
|
||||
case ChannelTypes.GUILD_PRIVATE_THREAD: {
|
||||
channel = new ThreadChannel(guild, data, client, fromInteraction);
|
||||
channel = new ThreadChannel(guild, data, client);
|
||||
if (!allowUnknownGuild) channel.parent?.threads.cache.set(channel.id, channel);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ const { resolveAutoArchiveMaxLimit } = require('../util/Util');
|
||||
* @implements {TextBasedChannel}
|
||||
*/
|
||||
class ThreadChannel extends Channel {
|
||||
constructor(guild, data, client, fromInteraction = false) {
|
||||
constructor(guild, data, client) {
|
||||
super(guild?.client ?? client, data, false);
|
||||
|
||||
/**
|
||||
@@ -41,7 +41,7 @@ class ThreadChannel extends Channel {
|
||||
* @type {ThreadMemberManager}
|
||||
*/
|
||||
this.members = new ThreadMemberManager(this);
|
||||
if (data) this._patch(data, fromInteraction);
|
||||
if (data) this._patch(data);
|
||||
}
|
||||
|
||||
_patch(data, partial = false) {
|
||||
|
||||
@@ -58,12 +58,12 @@ class TextBasedChannel {
|
||||
* @property {boolean} [tts=false] Whether or not the message should be spoken aloud
|
||||
* @property {string} [nonce=''] The nonce for the message
|
||||
* @property {string} [content=''] The content for the message
|
||||
* @property {MessageEmbed[]|APIEmbed[]} [embeds] The embeds for the message
|
||||
* @property {Array<(MessageEmbed|APIEmbed)>} [embeds] The embeds for the message
|
||||
* (see [here](https://discord.com/developers/docs/resources/channel#embed-object) for more details)
|
||||
* @property {MessageMentionOptions} [allowedMentions] Which mentions should be parsed from the message content
|
||||
* (see [here](https://discord.com/developers/docs/resources/channel#allowed-mentions-object) for more details)
|
||||
* @property {FileOptions[]|BufferResolvable[]|MessageAttachment[]} [files] Files to send with the message
|
||||
* @property {MessageActionRow[]|MessageActionRowOptions[]} [components]
|
||||
* @property {Array<(FileOptions|BufferResolvable|MessageAttachment[])>} [files] Files to send with the message
|
||||
* @property {Array<(MessageActionRow|MessageActionRowOptions)>} [components]
|
||||
* Action rows containing interactive components for the message (buttons, select menus)
|
||||
* @property {MessageAttachment[]} [attachments] Attachments to send in the message
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user