@@ -258,10 +258,10 @@ module.exports = ApplicationCommandManager;
|
||||
|
||||
/**
|
||||
* @external SlashCommandBuilder
|
||||
* @see {@link https://discord.js.org/#/docs/builders/main/class/SlashCommandBuilder}
|
||||
* @see {@link https://discord.js.org/docs/packages/builders/stable/SlashCommandBuilder:Class}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @external ContextMenuCommandBuilder
|
||||
* @see {@link https://discord.js.org/#/docs/builders/main/class/ContextMenuCommandBuilder}
|
||||
* @see {@link https://discord.js.org/docs/packages/builders/stable/ContextMenuCommandBuilder:Class}
|
||||
*/
|
||||
|
@@ -33,10 +33,10 @@ class ChannelManager extends CachedManager {
|
||||
* @name ChannelManager#cache
|
||||
*/
|
||||
|
||||
_add(data, guild, { cache = true, allowUnknownGuild = false, fromInteraction = false } = {}) {
|
||||
_add(data, guild, { cache = true, allowUnknownGuild = false } = {}) {
|
||||
const existing = this.cache.get(data.id);
|
||||
if (existing) {
|
||||
if (cache) existing._patch(data, fromInteraction);
|
||||
if (cache) existing._patch(data);
|
||||
guild?.channels?._add(existing);
|
||||
if (ThreadChannelTypes.includes(existing.type)) {
|
||||
existing.parent?.threads?._add(existing);
|
||||
@@ -44,7 +44,7 @@ class ChannelManager extends CachedManager {
|
||||
return existing;
|
||||
}
|
||||
|
||||
const channel = Channel.create(this.client, data, guild, { allowUnknownGuild, fromInteraction });
|
||||
const channel = Channel.create(this.client, data, guild, { allowUnknownGuild });
|
||||
|
||||
if (!channel) {
|
||||
this.client.emit(Events.DEBUG, `Failed to find guild, or unknown type for channel ${data.id} ${data.type}`);
|
||||
|
@@ -299,11 +299,14 @@ class RoleManager extends CachedManager {
|
||||
const resolvedRole2 = this.resolve(role2);
|
||||
if (!resolvedRole1 || !resolvedRole2) throw new TypeError('INVALID_TYPE', 'role', 'Role nor a Snowflake');
|
||||
|
||||
if (resolvedRole1.position === resolvedRole2.position) {
|
||||
const role1Position = resolvedRole1.position;
|
||||
const role2Position = resolvedRole2.position;
|
||||
|
||||
if (role1Position === role2Position) {
|
||||
return Number(BigInt(resolvedRole2.id) - BigInt(resolvedRole1.id));
|
||||
}
|
||||
|
||||
return resolvedRole1.position - resolvedRole2.position;
|
||||
return role1Position - role2Position;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user