chore: v2.9.6

fix: guildMemberFetch (options.user)
This commit is contained in:
March 7th
2022-11-25 19:45:42 +07:00
parent ecc59912d0
commit c62c25de53
5 changed files with 7 additions and 7 deletions

View File

@@ -176,7 +176,7 @@ class GuildMemberManager extends CachedManager {
* @see {@link https://github.com/aiko-chan-ai/discord.js-selfbot-v13/blob/main/Document/FetchGuildMember.md}
*/
fetch(options) {
if (!options || !options?.query) {
if (!options || (!options?.query && !options?.user)) {
// Check Permissions
if (
this.guild.me.permissions.has('KICK_MEMBERS') ||

View File

@@ -86,9 +86,10 @@ 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<User>}
*/
async fetch(user, { cache = true, force = false } = {}) {
async fetch(user, { cache = true, force = false, guildId = null } = {}) {
const id = this.resolveId(user);
if (!force) {
const existing = this.cache.get(id);
@@ -97,8 +98,7 @@ class UserManager extends CachedManager {
const data = await this.client.api.users(id).get();
const userObject = this._add(data, cache);
await userObject.getProfile().catch(() => {});
// Clear not because event emitted .-. Bug report by https://github.com/aSashaaa
await userObject.getProfile(guildId ?? null).catch(() => {});
return userObject;
}