chore: v2.9.6
fix: guildMemberFetch (options.user)
This commit is contained in:
parent
ecc59912d0
commit
c62c25de53
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "discord.js-selfbot-v13",
|
||||
"version": "2.9.5",
|
||||
"version": "2.9.6",
|
||||
"description": "A unofficial discord.js fork for creating selfbots [Based on discord.js v13]",
|
||||
"main": "./src/index.js",
|
||||
"types": "./typings/index.d.ts",
|
||||
|
@ -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') ||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
2
typings/index.d.ts
vendored
2
typings/index.d.ts
vendored
@ -4093,7 +4093,7 @@ export class UserManager extends CachedManager<Snowflake, User, UserResolvable>
|
||||
private dmChannel(userId: Snowflake): DMChannel | null;
|
||||
public createDM(user: UserResolvable, options?: BaseFetchOptions): Promise<DMChannel>;
|
||||
public deleteDM(user: UserResolvable): Promise<DMChannel>;
|
||||
public fetch(user: UserResolvable, options?: BaseFetchOptions): Promise<User>;
|
||||
public fetch(user: UserResolvable, options?: BaseFetchOptions & { guildId?: Snowflake }): Promise<User>;
|
||||
public fetchFlags(user: UserResolvable, options?: BaseFetchOptions): Promise<UserFlags>;
|
||||
public send(user: UserResolvable, options: string | MessagePayload | MessageOptions): Promise<Message>;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user