From 1583c399c35cf144627a3fb8ae64420c4e2c6a8a Mon Sep 17 00:00:00 2001 From: Elysia <71698422+aiko-chan-ai@users.noreply.github.com> Date: Sat, 13 Jan 2024 19:31:22 +0700 Subject: [PATCH] Update UserManager.js --- src/managers/UserManager.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/managers/UserManager.js b/src/managers/UserManager.js index e5fd8d9..ca72b10 100644 --- a/src/managers/UserManager.js +++ b/src/managers/UserManager.js @@ -60,12 +60,11 @@ class UserManager extends CachedManager { data: { recipients: [id], }, - headers: { - 'X-Context-Properties': 'e30=', // {} - }, + DiscordContext: {}, }); + const dm_channel = await this.client.channels._add(data, null, { cache }); - await dm_channel.sync(); + dm_channel.sync(); return dm_channel; } @@ -87,10 +86,9 @@ class UserManager extends CachedManager { * Obtains a user from Discord, or the user cache if it's already available. * @param {UserResolvable} user The user to fetch * @param {BaseFetchOptions} [options] Additional options for this fetch - * @param {?Snowflake} [options.guildId] The guild ID to fetch the member for * @returns {Promise} */ - async fetch(user, { cache = true, force = false, guildId = null } = {}) { + async fetch(user, { cache = true, force = false } = {}) { const id = this.resolveId(user); if (!force) { const existing = this.cache.get(id); @@ -98,9 +96,7 @@ class UserManager extends CachedManager { } const data = await this.client.api.users(id).get(); - const userObject = this._add(data, cache); - await userObject.getProfile(guildId ?? null).catch(() => {}); - return userObject; + return this._add(data, cache); } /**