From 2a3feef24057ecd8928fb8f9b2b2469097b53cbf Mon Sep 17 00:00:00 2001 From: Starman <30315137+Starman3787@users.noreply.github.com> Date: Fri, 15 Nov 2024 20:11:53 +0000 Subject: [PATCH] fix user --- src/gateway/eventHandler.js | 3 --- src/managers/GuildMemberManager.js | 2 -- src/structures/Guild.js | 1 - src/structures/SlashCommand.js | 3 ++- src/structures/VoiceState.js | 1 - 5 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/gateway/eventHandler.js b/src/gateway/eventHandler.js index c9704f9b..0a6db35a 100644 --- a/src/gateway/eventHandler.js +++ b/src/gateway/eventHandler.js @@ -294,7 +294,6 @@ class EventHandler { const member = new Member(this.#_client, data, { userId: data.user.id, guildId: data.guild_id, - user: data.user, }); member.guild.incrementMemberCount(); @@ -346,7 +345,6 @@ class EventHandler { const newMember = new Member(this.#_client, data, { userId: data.user.id, guildId: data.guild_id, - user: data.user, }); this.#_client.emit(EVENTS.GUILD_MEMBER_UPDATE, oldMember, newMember); @@ -363,7 +361,6 @@ class EventHandler { new Member(this.#_client, data.members[i], { userId: data.members[i].user.id, guildId: data.guild_id, - user: data.members[i].user, }); } diff --git a/src/managers/GuildMemberManager.js b/src/managers/GuildMemberManager.js index 5364d62f..18c62b33 100644 --- a/src/managers/GuildMemberManager.js +++ b/src/managers/GuildMemberManager.js @@ -144,7 +144,6 @@ class GuildMemberManager extends BaseCacheManager { return new Member(client, data, { userId, guildId, - user: data.user, }); } @@ -186,7 +185,6 @@ class GuildMemberManager extends BaseCacheManager { new Member(client, data[i], { userId: data[i].user.id, guildId, - user: data[i].user, }), ); diff --git a/src/structures/Guild.js b/src/structures/Guild.js index f3eaeaac..ed120a51 100644 --- a/src/structures/Guild.js +++ b/src/structures/Guild.js @@ -496,7 +496,6 @@ class Guild { new Member(this.#_client, data.members[i], { userId: data.members[i].user.id, guildId: data.id, - user: data.members[i].user, nocache, }); diff --git a/src/structures/SlashCommand.js b/src/structures/SlashCommand.js index f080633b..94253387 100644 --- a/src/structures/SlashCommand.js +++ b/src/structures/SlashCommand.js @@ -5,6 +5,7 @@ import util from "util"; import Member from "./Member.js"; import Role from "./Role.js"; import cacheChannel from "../util/gluon/cacheChannel.js"; +import User from "./User.js"; /** * Represents a slash command. @@ -40,7 +41,7 @@ class SlashCommand extends Interaction { new Member(client, value, { userId: key, guildId: data.guild_id, - user: data.data.resolved.users[key], + user: new User(client, data.data.resolved.users[key]), }); if (data.data.resolved?.roles) for (const value of Object.values(data.data.resolved.roles)) diff --git a/src/structures/VoiceState.js b/src/structures/VoiceState.js index 8c014143..a7e6e673 100644 --- a/src/structures/VoiceState.js +++ b/src/structures/VoiceState.js @@ -97,7 +97,6 @@ class VoiceState { this.#member = new Member(this.#_client, data.member, { userId: data.user_id, guildId: data.guild_id, - user: data.member.user, nocache, }); else this.#member = this.guild?.members.get(data.user_id) || null;