fix: Miscellaneous fixes

#9445 djs
This commit is contained in:
Elysia
2023-05-02 11:34:13 +07:00
parent fbaf7ed7c8
commit f4dbc57f42
16 changed files with 45 additions and 27 deletions

View File

@@ -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}`);